14.04 LTSmysql
配置/etc/mysql/my.cnf,在[mysqld]下加入一行 skip-grant-tablessql
sudo service mysql restartmysql
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