linux下忘記MySQL密碼

14.04 LTSmysql

配置/etc/mysql/my.cnf,在[mysqld]下加入一行 skip-grant-tablessql

 sudo service mysql restart  

mysql  
mysql> use mysql 
mysql>update user set password=PASSWORD("new_password") where user='root'; 新密碼爲new_password
vim

vim /etc/mysql/my.cnf,註釋skip-grant-table
rest

sudo service mysql restart。ip

相關文章
相關標籤/搜索