MySQL Login issues

Source: Internet
Author: User
Tags mysql login

One, MySQL login error

Mysqladmin:connect to server at ' localhost ' failed

Error: ' Access denied for user ' root ' @ ' localhost ' (using Password:yes) '

Workaround: Hack the MySQL password

1> stop MySQL service: service mysqld Stop

2> Execute command:> mysqld_safe--skip-grant-tables & mysql-uroot-p Enter

> Use mysql;

> Update user set Password=password ("Newpass") where user= "root";

Change Password to newpass

> flush privileges; Update Permissions

> quit quitting

3> Restart MySQL services: Servicemysqld Restart

4> Link Database:mysql-uroot-p New Password

Second, forget the local root login password code

Resolution process:

1. Edit /etc/my.cnf

Add a row in the [mysqld] configuration section

Skip-grant-tables

2. Restart MySQL after saving

[Email protected] etc]# service mysqld restart
3. Log in to the database to reset the root password

[email protected] ~]# mysql-uroot-p MySQL
Enter Password:

Direct Carriage Enter

mysql>show databases;
Execute the following statement
mysql> Update user set Password=password ("MySQL") where user= ' root ';
mysql> flush Privileges;

4, Delete the "skip-grant-tables" line added in the/etc/my.cnf file, restart MySQL;

With the new password will be able to log in normally;

Original link: http://blog.sina.com.cn/s/blog_8442befd01015zld.html

MySQL Login issues

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.