很久前在ubuntu安装了lamp。想起来鼓捣鼓捣的时候发现死活想不起来mysql的root密码了
http://tdhome.hlw.cn/show.php?id=517
MySQL root密码忘记的解决
1.先停掉mysql
# sudo /etc/init.d/mysql stop
2.以--skip-grant-table 的參數啟動mysql
# sudo mysqld_safe --skip-grant-table&
3. 更改root 密碼 x1405e
# mysql mysql
mysql> UPDATE user SET password=password('x1405e') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> exit
4.停掉mysql再重跑
sudo killall mysqld
#/sudo etc/rc.d/init.d/mysqld
#sudo mysql -u root -p
Enter password:
http://tdhome.hlw.cn/show.php?id=517
MySQL root密码忘记的解决
1.先停掉mysql
# sudo /etc/init.d/mysql stop
2.以--skip-grant-table 的參數啟動mysql
# sudo mysqld_safe --skip-grant-table&
3. 更改root 密碼 x1405e
# mysql mysql
mysql> UPDATE user SET password=password('x1405e') WHERE user='root';
mysql> FLUSH PRIVILEGES;
mysql> exit
4.停掉mysql再重跑
sudo killall mysqld
#/sudo etc/rc.d/init.d/mysqld
#sudo mysql -u root -p
Enter password: