Mysql connection Linux error: Access denied for user 'root' @ 'localhost' (using password: YES) solution, mysqldenied
Preface
Recently connected to linuxmysql /usr/local/mysql/bin/mysql -uroot -p
Enter PasswordAccess denied for user 'root'@'localhost'(using password: YES)
Error. I won't talk much about it below. Let's take a look at the detailed solution.
Solution:
1. Stop the mysql service first
service mysqld stop
2. Go to the mysql installation directory bin/use safe mode and restart:
./mysqld_safe --skip-grant-tables
3. Use the root account and log on without a password. Change the root user password.
Mysql-u root use mysqlupdate user set password = PASSWORD ("your password") where User = 'root ';
4. Restart mysql and log on normally
Service mysqld restart
/usr/local/mysql/bin/mysql -uroot -p
Enter the password you just reset.
Finished. Connection successful!
Summary
The above is all the content of this article. I hope the content of this article has some reference and learning value for everyone's learning or work. If you have any questions, please leave a message to us, thank you for your support.