For a long time not using Ubuntu, come in to play today, the result even the root user password of the MySQL forgot. On the internet to find a bit, found the following solutions, try a bit, feasible! It is important to note that environmental issues are recorded here.
Ubuntu Server 12.04 LTS, with Apt-get installation of the MySQL process is not prompted to set the root account password, after the installation of the discovery root empty password can not log in.
Solution:
In fact, the Debian Department of the MySQL installation process will be set up a default account, this file has saved the default account information
cat /etc/mysql/debian.cnf
Note: The password here is clear text!
Then we can use this account to log in to MySQL
mysql -udebian-default-account -pdefaultpassword
This account has permission to operate the MySQL database, so we can change the root password
use mysqlset password for ‘root‘@‘localhost‘ = password(‘yourpass‘);
OK!
再次使用新设的root密码可以进行登陆了!
The third Ubuntu, MySQL root user password forgot what to do?