Help Center/ Cloud Data Migration/ FAQs/ Troubleshooting/ What Should I Do If All Users Except User root Cannot Access RDS for MySQL?
Updated on 2023-06-21 GMT+08:00

What Should I Do If All Users Except User root Cannot Access RDS for MySQL?

Solution

  1. Log in to the server, run the mysql -u root –p command to access the database, and enter the password.
  2. Run the mysql>use mysql command.
  3. Authorize users to access the database:

    For example, if you want to enable user root to access the MySQL server from any host using password 123456, run the following command:

    mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;

    If you want to enable user abc to access the MySQL server from a host whose IP address is 10.10.50.127 using password 654321, run the following command:

    mysql>GRANT ALL PRIVILEGES ON *.* TO 'abc'@'10.10.50.127' IDENTIFIED BY '654321' WITH GRANT OPTION;

  1. Run the mysql>FLUSH PRIVILEGES command to refresh permissions.