docker mysql Access denied for user ‘root‘@‘localhost‘ (using password: YES)

Solution

Reset the password and modify the remote access permissions of the root user

Stop the MySQL service

Enter the MySQL bin directory through the command line, enter "mysql -u root -p" (without entering a password), and press Enter to enter the database.

Execute "use mysql;" to use the mysql database.

Execute "ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';" (modify root's password)

Open the MySQL configuration file, delete "skip-grant-tables", save and close the file.

Restart the MySQL service.

Enter "mysql -u root -p 123456" on the command line to successfully connect to the database

Guess you like

Origin blog.csdn.net/qq_39128430/article/details/128955306