成人国产在线小视频_日韩寡妇人妻调教在线播放_色成人www永久在线观看_2018国产精品久久_亚洲欧美高清在线30p_亚洲少妇综合一区_黄色在线播放国产_亚洲另类技巧小说校园_国产主播xx日韩_a级毛片在线免费

資訊專欄INFORMATION COLUMN

MYSQL 重置 root 密碼

lauren_liuling / 954人閱讀

**1.停止MYSQL服務;
在Ubuntu 或 Debian上
sudo service mysql stop
或者
sudo /etc/init.d/mysql stop
在CentOS, Fedora, RHEL上:
sudo service mysqld stop
或者
sudo /etc/init.d/mysqld stop
2.進入安全模式
sudo mysqld_safe --skip-grant-tables &
PS:最后的&符號是要有的
你可能會看到這樣的信息:
mysqld_safe Can"t log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
mysqld_safe Logging to "/var/log/mysql/error.log".
mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
出現(xiàn)這些類似信息之后,你可以按CTRL+C退出,然后進行下一步
NOTES:如果,我是說如果,沒有報錯請直接跳到第三步,在這你遇到報錯
mysqld_safe Can"t log to error log and syslog at the same time. Remove all --log-error configuration options for --syslog to take effect.
mysqld_safe Logging to "/var/log/mysql/error.log".
mysqld_safe A mysqld process already exists
請使用以下命令來確認mysql是否真的終止了
ps uaxww | grep -i mysql
一旦找到,就用kill將進程終止,再重試一次
3.使用空密碼登錄
mysql -u root
4.使用mysql數(shù)據(jù)庫
use mysql;
你會看到這樣的類似信息:
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
5.重新設置密碼
update user set password=PASSWORD("yournewpassword") where User="root";

yournewpassword 替換為你設置的密碼

你大概會看到這些:
mysql> update user set password=PASSWORD("yournewpassword") where User="root";
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4 Changed: 4 Warnings: 0

6.重新設置權限

flush privileges;
如果出現(xiàn)以下熟悉的提示,基本上大功告成。
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
7.退出
quit

8.重啟MYSQL

在Ubuntu 或 Debian上
sudo /etc/init.d/mysql stop
然后
sudo /etc/init.d/mysql start
在CentOS, Fedora, RHEL上:
sudo /etc/init.d/mysqld stop
然后
sudo /etc/init.d/mysqld start

9.重新登錄

mysql -u root -p
輸入剛剛設置的密碼。DONE**

文章版權歸作者所有,未經(jīng)允許請勿轉載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。

轉載請注明本文地址:http://systransis.cn/yun/23036.html

相關文章

發(fā)表評論

0條評論

最新活動
閱讀需要支付1元查看
<