mysql8.0.19忘記密碼處理方法詳解
1在配置文件中添加skip-grant-tables后重啟mysql,然后直接登錄
[root@tyjs09 ~]# cat /etc/my.cnf [mysqld] user=mysql basedir=/application/mysql datadir=/data/mysql/data socket=/tmp/mysql.sock server_id=6 port=3306 gtid-mode=on enforce-gtid-consistency=true log_error=/data/mysql/data/mysql.log log_bin=/data/binlog/mysql-bin secure-file-priv=/tmp innodb_flush_method=O_DIRECT lower_case_table_names=1 skip-grant-tables
2更新密碼
mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> alter user "root"@"localhost" identified by "123456"; ERROR 1396 (HY000): Operation ALTER USER failed for 'root'@'localhost' mysql> use mysql;select user,host from user;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 '123456'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges;
3在配置文件中去掉免登錄然后重啟mysql:
[root@tyjs09 ~]# vim /etc/my.cnf [mysqld] user=mysql basedir=/application/mysql datadir=/data/mysql/data socket=/tmp/mysql.sock server_id=6 port=3306 gtid-mode=on enforce-gtid-consistency=true log_error=/data/mysql/data/mysql.log log_bin=/data/binlog/mysql-bin secure-file-priv=/tmp innodb_flush_method=O_DIRECT lower_case_table_names=1 skip-grant-tables #去掉
[root@tyjs09 ~]# service mysql restart Shutting down MySQL.. SUCCESS! Starting MySQL. SUCCESS! [root@tyjs09 ~]# mysql -uroot -p123456 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.19 MySQL Community Server - GPL Copyright (c) 2000, 2020, 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>
到此這篇關(guān)于mysql8.0.19忘記密碼處理方法詳解的文章就介紹到這了,更多相關(guān)mysq忘記密碼處理內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- Windows 8.1下MySQL5.7 忘記root 密碼的解決方法
- Windows10系統(tǒng)下Mysql8.0.13忘記root密碼的操作方法
- mysql8.0.19忘記密碼的完美解決方法
- MySQL8下忘記密碼后重置密碼的辦法(MySQL老方法不靈了)
- mysql8.0忘記密碼的詳細(xì)解決方法
- MySQL8忘記密碼的快速解決方法
- MySQL 8忘記密碼的最佳處理方式淺析
- mysql 8.0.18 壓縮包安裝及忘記密碼重置所遇到的坑
- mysql8.0忘記密碼修改與net命令服務(wù)名無(wú)效問(wèn)題
- MySQL8.0/8.x忘記密碼更改root密碼的實(shí)戰(zhàn)步驟(親測(cè)有效!)
相關(guān)文章
MySQL數(shù)據(jù)庫(kù)之表的約束圖文詳解
在數(shù)據(jù)庫(kù)設(shè)計(jì)中,表約束是保證數(shù)據(jù)完整性、一致性的重要手段,數(shù)據(jù)類型本身就是一種基本約束,限制了數(shù)據(jù)的范圍和格式,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下2024-09-09
MySQL錯(cuò)誤:ERROR?1049?(42000):?Unknown?database?‘nonexiste
這篇文章主要給大家介紹了關(guān)于MySQL錯(cuò)誤:ERROR?1049?(42000):?Unknown?database?‘nonexistentdb‘的簡(jiǎn)單解決辦法,這個(gè)錯(cuò)誤通常是由于連接的數(shù)據(jù)庫(kù)不存在導(dǎo)致的,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下2024-07-07
mysql執(zhí)行計(jì)劃id為空(UNION關(guān)鍵字)詳解
這篇文章主要給大家介紹了關(guān)于mysql執(zhí)行計(jì)劃id為空(UNION關(guān)鍵字)的相關(guān)資料,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2018-09-09
mysql 終結(jié)點(diǎn)映射器中沒(méi)有更多的終結(jié)點(diǎn)可用的解決方法
在安裝MySQL的時(shí)候遇到“終結(jié)點(diǎn)映射器中沒(méi)有更多的終結(jié)點(diǎn)可用”提示2009-03-03
Mysql數(shù)據(jù)庫(kù)性能優(yōu)化一
今天,數(shù)據(jù)庫(kù)的操作越來(lái)越成為整個(gè)應(yīng)用的性能瓶頸了,這點(diǎn)對(duì)于Web應(yīng)用尤其明顯。關(guān)于數(shù)據(jù)庫(kù)的性能,這并不只是DBA才需要擔(dān)心的事,而這更是我們程序員需要去關(guān)注的事情2016-04-04
MySQL多實(shí)例安裝開機(jī)自啟動(dòng)服務(wù)配置過(guò)程
這篇文章主要介紹了MySQL中,多實(shí)例安裝開機(jī)自啟服務(wù)配置的過(guò)程詳細(xì)步驟,有需要的朋友可以借鑒參考下,希望可以有所幫助,感謝閱讀2021-09-09

