Access denied for user & #39; root & #39; @ & #39; localhost & #39; (using password: YES) Error solution for mysql connection in Linux, mysqldenied

Source: Internet
Author: User

Access denied for user 'root' @ 'localhost' (using password: YES) Error solution for mysql connection in Linux, mysqldenied
Connect to mysql in linux/Usr/local/mysql/bin/mysql-uroot-pWhen you enter the password, the following error occurs: Access denied for user 'root' @ 'localhost' (using password: YES.

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 and enter the Reset Password.

Finished. Connection successful!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.