Mysql password expired. Can't connect
If your MySQL password has expired and you can't connect, you will need to reset the password. Here are the steps to reset the password:
- Stop the MySQL server:
sudo service mysql stop
- Start the MySQL server in safe mode with the skip-grant-tables option:
sudo mysqld_safe --skip-grant-tables &
- Connect to MySQL:
mysql -u root
- Update the password for the root user:
UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='root';
- Reload the privilege tables:
FLUSH PRIVILEGES;
- Exit MySQL:
exit
- Stop the MySQL server:
sudo service mysql stop
- Start the MySQL server normally:
sudo service mysql start
You should now be able to connect to MySQL using the new password you set.