New Installation MySQL Login error

Source: Internet
Author: User

After the MySQL 5.6.27 database installation is complete


First, set the password to use the mysqladmin command


Mysqladmin-u Root Password


ENTER:PASSWD #这里设置为123456


Log in to the database for the first time, using the MySQL command (remember not to enter the password 123456)

Grant all privileges on * * to ' root ' @ '% ' identified by ' 123456 ' with GRANT OPTION; #授权


Test using NAVICAT Login to access the database normally


Next time on a visit strange thing happened


[Email protected] ~]# mysql-uroot-p

Enter Password:

ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)


But the direct use of MySQL command can be accessed normally


mysql> use MySQL

ERROR 1044 (42000): Access denied for user "@ ' localhost ' to database ' MySQL '


Unfortunately view database, no MySQL library


mysql> show databases;

+--------------------+

| Database |

+--------------------+

| Information_schema |

| Test |

+--------------------+


Workaround Stop the database


Stopping the database


Modify the MySQL configuration file


Skip-grant-tables Skip permission Verification is commented out, remove comments, restart MySQL


After rebooting, you can see the MySQL database


mysql> show databases;

+--------------------+

| Database |

+--------------------+

| Information_schema |

| AA |

| MySQL |

| Performance_schema |

| Test |

+--------------------+

5 rows in Set (0.00 sec)


After starting the database, found that the password set to the MySQL database is invalid, even if you do not enter a password can be accessed, root is the ordinary user is also.

Whether the user has skipped the password authentication resulting in no need to enter a password can also be accessed


Try to change the root password


Not to be continued





This article is from the "10852974" blog, please be sure to keep this source http://10862974.blog.51cto.com/10852974/1774769

New Installation MySQL Login error

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.