原因: 鏈接數(shù)據(jù)庫(kù)忘記用戶密碼, 配置文件/etc/my.cnf中增加skip-grant-table 跳過(guò)密碼登錄,進(jìn)入服務(wù)器修改密碼時(shí),出現(xiàn)如下報(bào)錯(cuò)信息:
mysql> alter user root@'localhost' identified by '123';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
解決方法:
1、重啟數(shù)據(jù)庫(kù)服務(wù)器
? ? ?]#?service mysql restart
2、鏈接數(shù)據(jù)庫(kù)服務(wù)器
? ? ?]# mysql
? ? ?mysql>??flush privileges;? ? ? ? ? ? ?刷新權(quán)限列表
? ? ?mysql>?alter user root@'localhost' identified by '123';? ? ?更改用戶密碼
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> alter user root@'localhost' identified by '123';
Query OK, 0 rows affected (0.00 sec)
?3、退出數(shù)據(jù)庫(kù)服務(wù)器,注釋配置文件? #skip-grant-table, 重啟數(shù)據(jù)庫(kù)服務(wù)器器
4、驗(yàn)證用戶是否登錄文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-716979.html
[root@master-2 mysql]# mysql -uroot -p123
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.31 MySQL Community Server - GPL
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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> exit
? ? ?文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-716979.html
到了這里,關(guān)于The MySQL server is running with the --skip-grant-tables option so it cannot execute this state的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!