欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Ubuntu下MySQL root密碼忘記的解決方法

 更新時(shí)間:2017年05月10日 09:42:12   作者:azhegps  
本文給大家分享Ubuntu下MySQL root密碼忘記的解決方法,非常不錯(cuò),具有參考借鑒價(jià)值,需要的的朋友參考下吧

Linux下忘記MySQL root密碼解決方法,基于Ubuntu 14.04 LTS。

本文是在root用戶(hù)下進(jìn)行操作,其他操作需要對(duì)應(yīng)權(quán)限

編輯mysql的配置文件/etc/mysql/my.cnf,在[mysqld]段下加入一行“skip-grant-tables”。

重啟mysql服務(wù)

sudo service mysql restart 

用空密碼進(jìn)入mysql管理命令行,切換到mysql庫(kù)。

root@DENGJAMESLI:~$ mysql 
Welcome to the MySQL monitor. Commands end with ; or \g. 
mysql> use mysql 
mysql> update user set password=PASSWORD("new_pass") where user='root'; 
Query OK, 0 rows affected (0.00 sec) 
Rows matched: 4 Changed: 0 Warnings: 0 
mysql>quit

回到vim /etc/mysql/my.cnf,把剛才加入的那一行“skip-grant-tables”注釋或刪除掉。

再次重啟mysql服務(wù)sudo service mysql restart,使用新的密碼登陸,修改成功。

www.linuxidc.com @ubuntu:~$ mysql -u root -p new_pass 
Welcome to the MySQL monitor. Commands end with ; or \g. 
mysql>

以上所述是小編給大家介紹的Ubuntu下忘記MySQL root密碼解決方法,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論