MySQL on skip-name-resolve causes root@127.0.0.1 (localhost) Access error 1045 (28000) Errors Solution

Source: Internet
Author: User

Why Configure Skip-name-resolve?

Because the remote access speed of MYSQL-H${IP} is too slow,

mysql-h172. 16.66. 171 -uroot-p123456

According to the user experience (https://www.cnblogs.com/yjf512/p/3803762.html),

vi/etc/my.cnf

[Mysqld]skip-name-resolve

Restart MySQL, find the remote access MSYQL speed up, solve the problem.

However, new problems have been raised:

However, it is found that msyql (mysql-h127.0.0.1-uroot-p123456) cannot be accessed locally:

[Email protected] ~]# mysql-h127. 0.0. 1 -uroot-interface1045 (28000for' ) Root'@'127.0.0.1' (using password:yes)

You can access it without entering a password (mysql-h127.0.0.1-uroot).

[Email protected] ~]# mysql-h127.0.0.1-Uroot Welcome to the MySQL Monitor. Commands End With; or \g.your MySQL connection ID is 91114Server Version:5.6. *-log MySQL Community Server (GPL) Copyright (c) -, ., Oracle and/or its affiliates. All rights reserved. Oracle isA registered trademark of Oracle Corporation and/or Itsaffiliates. Other names trademarks of their respectiveowners. Type'Help ;'Or'\h'  forHelp. Type'\c'To clear the current input statement.mysql>

Workaround:

Reference (http://blog.sina.com.cn/s/blog_759a5a7c01017dj0.html), Reset root password:

[Email protected] ~]#mysql-h127.0.0.1-  uroot Welcome to the MySQL Monitor. Commands End With; or \g.your MySQL connection ID is 91114Server Version:5.6. *-log MySQL Community Server (GPL) Copyright (c) -, ., Oracle and/or its affiliates. All rights reserved. Oracle isA registered trademark of Oracle Corporation and/or Itsaffiliates. Other names trademarks of their respectiveowners. Type'Help ;'Or'\h'  forHelp. Type'\c'To clear the current input statement.mysql>Use  MySQL; Database Changedmysql>Update user Set Password=password ("123456") where user= "root"; Query OK,3Rows Affected (0.06sec) Rows matched:5Changed:3Warnings:0MySQL> flush Privileges; Query OK,0Rows Affected (0.13sec) MySQL> quitBye
[Email protected] ~]#

With mysql-h127.0.0.1-uroot-p123456 access, problem solving.

[Email protected] ~]# mysql-h127.0.0.1-uroot-p123456warning:using A password on the command lineInterfacecan be insecure.  Welcome to the MySQL Monitor. Commands End With; or \g.your MySQL connection ID is 2487Server Version:5.6. *-log MySQL Community Server (GPL) Copyright (c) -, ., Oracle and/or its affiliates. All rights reserved. Oracle isA registered trademark of Oracle Corporation and/or Itsaffiliates. Other names trademarks of their respectiveowners. Type'Help ;'Or'\h'  forHelp. Type'\c'To clear the current input statement.mysql>

Since the error 1045 (28000) on the Internet is not available on the skip-name-resolve, it took most of the day to solve the problem, so publish this article.

My First Blog on cnblogs!

MySQL on skip-name-resolve causes [email protected](localhost) Access error 1045 (28000) Errors Solution

Related Article

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.