Use the "ignore authorization table" parameter to log on to a multi-instance database.

Source: Internet
Author: User
Yesterday morning, in the video "L10-008-lamp environment of MySQL multi-instance installation Configuration Guide" is about to end, again encountered problems. The night before, according to the video, after cleaning up the redundant MySQL database account, the database will be directly exited and shut down (after the account is not cleared, the database will be exited and the database will be logged on again-in fact, and there is no need to do

Yesterday morning, in the video "L10-008-lamp environment of MySQL multi-instance installation Configuration Guide" is about to end, again encountered problems. The night before, according to the video, after cleaning up the redundant MySQL database account, the database will be directly exited and shut down (after the account is not cleared, the database will be exited and the database will be logged on again-in fact, and there is no need to do

Yesterday morning, in the video "L10-008-lamp environment of MySQL multi-instance installation Configuration Guide" is about to end, again encountered problems.

The night before, according to the video, after cleaning up the redundant MySQL database account, the database will be directly exited and shut down (after the account is not cleared, the database will be exited and the database will be logged on again-in fact, there is no need to do such a test ). I opened the virtual machine yesterday morning and wanted to complete the last small part of the video. Unexpectedly, I did not log on to the 3306 instance with a password.

[root@Web 3306]# mysql -uroot -p -S /data/3306/mysql.sockEnter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)[root@Web 3306]# mysql -uroot -p'oldboy3306' -S /data/3306/mysql.sockERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

Searching for this error message on Baidu leads me astray. No correct solution was found through the error log.

A lot of information is reset the password, this approach in oldboy "L10-002-MySQL commonly used basic commands-view help and change the password 02" video also said. However, all the information is the password reset for a single instance.

I had to send this question to the QQ group. There was no message in the morning. In the afternoon, I tried to ask the QQ Group again, and some people finally replied to my command for resetting the password for multiple instances. In this way, I can use the Reset Password to try to log on to the database.

However, after changing the password, the logon error still persists. It seems that this issue has nothing to do with the password.

Here, we will sort out the password reset operations for multiple instances for future reference.


If you forget the password for logging on to a multi-instance database, you must use the "ignore authorization table" parameter to log on to the database. However, commands are slightly different from those used by a single instance.

[root@Web ~]# netstat -lnt|grep 330tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN[root@Web ~]# killall mysqld[root@Web ~]# killall mysqld[root@Web ~]# killall mysqldmysqld: no process killed[root@Web ~]# mysqld_safe --defaults-file=/data/3306/my.cnf --skip-grant-table &[1] 6015140607 15:11:58 mysqld_safe Logging to '/data/3306/mysql_oldboy3306.err'.140607 15:11:59 mysqld_safe Starting mysqld daemon with databases from /data/3306/data[root@Web ~]# netstat -lnt|grep 330tcp        0      0 0.0.0.0:3306                0.0.0.0:*                   LISTEN

Password verification is not required for logging on to a multi-instance database:

[root@Web ~]# mysql -uroot -S /data/3306/mysql.sockWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 1Server version: 5.1.62-log Source distributionCopyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || mysql              || oldboy3306         || test               |+--------------------+4 rows in set (0.03 sec)mysql> select user,host,password from mysql.user;+------+-----------+-------------------------------------------+| user | host      | password                                  |+------+-----------+-------------------------------------------+| root | Web       | *007FFCA4271EE782CBEE4DB65344C906C10915BB || root | 127.0.0.1 | *007FFCA4271EE782CBEE4DB65344C906C10915BB |+------+-----------+-------------------------------------------+2 rows in set (0.00 sec)mysql> quitBye

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.