mysql5 7重置密碼方法

2021-07-09 03:56:09 字數 444 閱讀 1919

5.7和以前放置密碼的方法都不一樣了。

1.vim /etc/my.cnf 末尾加上

skip-grant-tables

2.service mysqld restart

3.mysql -p進入

4.由於許可權表沒有password這個欄位了使用

update mysql.user set authentication_string=password('123456') where user='root' and host='localhost';

flush privileges;

5.service mysql restart

6.這個時候需要用alter user 'root'@'localhost' identified by '!www123456';修改密碼否則很多操作無法使用

MySQL5 7重置root密碼

版本更新 緣故,好多網上的教程都不適用了,甚至連官網的文件也不是能夠順利操作的。如果 mysql 正在執行,首先殺之 killall term mysqld。執行mysqld safe skip grant tables 如果此時不想被遠端連線 mysqld safe skip grant tabl...

mysql5 7重置root密碼

1.首先在my.ini中加入skip grant tables免密登入 2.登入mysql uroot p密碼為空 3.選擇資料庫use mysql 4.update mysql.user set authentication string password 123456 where user ro...

重置mysql5 7密碼

其實想要重置 5.7 的密碼很簡單,就一層窗戶紙 1 修改 etc my.cnf,在 mysqld 小節下新增一行 skip grant tables 1 這一行配置讓 mysqld 啟動時不對密碼進行驗證 2 重啟 mysqld 服務 systemctl restart mysqld 3 使用 r...