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