When the end of the machine, can log on to linux but cannot log on to mysql: mysql-urootERROR1045 (28000): Accessdeniedforuserroot @ localhost (usingpassword: NO) mysql-uroot-perror: Accessdeniedforuserroot @ localhost (usingpassword: YES) This
When you encounter a zombie machine, you can log on to linux but cannot log on to mysql: mysql-u root ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO) mysql-u root-p error: 'Access denied for user' root' @ 'localhost' (using password: YES) 'Here
You can log on to linux, but cannot log on to mysql:
Mysql-u root
ERROR 1045 (28000): Access denied for user 'root' @ 'localhost' (using password: NO)
Mysql-u root-p
Error: 'Access denied for user' root' @ 'localhost' (using password: YES )'
If MySQL is running, killall-TERM mysqld is first killed.
Then start/usr/bin/mysqld_safe -- skip-grant-tables &
In this case, you can directly enter mysql to log on,
$ Mysql
Welcome to the MySQL monitor. Commands end with; or \ g.
Your MySQL connection id is 1
Server version: 5.6.14 MySQL Community Server (GPL)
Copyright (c) 2000,201 3, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
Affiliates. Other names may be trademarks of their respective
Owners.
Type 'help; 'or' \ H' for help. type' \ C' to clear the current input statement.
Mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with-
Database changed
Mysql> update user set password = password ("root") where user = "root ";
Query OK, 4 rows affected (0.68 sec)
Rows matched: 4 Changed: 4 Warnings: 0
Mysql> flush privileges
->;
Query OK, 0 rows affected (0.00 sec)
Mysql>
Run killall-TERM mysqld again
Then start service mysql start
Then mysql-uroot-p can be logged on with root.
An error is reported after Logon:
Mysql> use mysql
ERROR 1820 (HY000): You must set password before executing this statement
, After you run set password = PASSWORD ('root ');
Mysql> set password = PASSWORD ('root ');
Query OK, 0 rows affected (0.19 sec)
Mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with-
Database changed
Mysql>