MySQL Connect database error:
1251 client does not support authentication protocol requested by server; consider upgrading Mysql client ERROR 1396 (HY000): Operation ALTER USER failed for ‘root’@’localhost’
Pre-registered mysql
mysql -u root -p
Input password
mysql> use mysql;
mysql> select user,host from user;
Note that my root and host are ‘%’
you may execute:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
Change to:
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
Operation record:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';
ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost'
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 -A
Database changed
mysql> select user,host from user;
+------------------+-----------+
| user | host |
+------------------+-----------+
| root | % |
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
+------------------+-----------+
4 rows in set (0.00 sec)
mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
Read More:
- mysql ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executin
- MYSQL Error 1045 (28000): access denied for user ‘root’ @’localhost ‘(using password: Yes)
- After installing mysql5.7 on centos7, an error 1045 (28000) is reported: access denied for user ‘root’ @’localhost ‘(using PAS)
- [Solved] Access denied for user ‘root‘@‘localhost‘ (using password: YES)
- Mysqldump: Got error: 1045: Access denied for user ‘root‘@‘localhost‘
- [Solved] pymysql.err.OperationalError: (1045, “Access denied for user ‘root‘@‘192.168.118.44‘
- MYSQL Enter password:ERROR 2003 (HY000): Can‘t connect to MySQL server on ‘localhost:3306‘
- [Solved] Caused by: java.sql.SQLException: Access denied for user ‘root‘@‘hadoop102‘ (using password: YES)
- Mysql8.02/ubuntu 20 ERROR 1449 (HY000) [How to Solve]
- MySQL Error: errorCode 1130, state HY000 [How to Solve]
- Mysql5.7.18.1 Error 1054 (42S22): Unknown Column’password’ In’field List’ When Changing User Password
- [Solved] Error 1044: Access denied for user ‘syz-remote‘@‘%‘ to database ‘webapp‘
- MySQL 8.0 error 1114 (HY000): the table’sbtest1’is full (Fixed)
- Doris reports an error: error 1064 (HY000) [How to Solve]
- Ubuntu ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111)
- linux mysql ERROR 1820 (HY000): You must SET PASSWORD before executing this statement
- How to Fix MySQL ERROR 1130 (HY000): Host ‘XXXX’ is not allowed to connect to this MySQL server
- MYSQL Use cmd to change root password error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual tha
- [Solved] ERROR 2002 (HY000): Can’t connect to local MySQL server through socket’/var/lib/mysql/mysql.sock’ (2)
- [Solved] CentOS installs MySQL and starts MySQL with error 2002 (HY000)