Reset MySQL Root Password on Debian/Ubuntu
If you forgot your MySQL root password, you can reset it by following these steps.
1. Stop the MySQL service.
service mysql stop2. Start MySQL without password and permission checks.
mysqld_safe --skip-grant-tables &3. Press
[ENTER]again if your output is halted.4. Connect to MySQL.
mysql -u root mysql5. Run following commands to set a new password for
rootuser. SubstituteNEW_PASSWORDwith your new password.UPDATE user SET password=PASSWORD('NEW_PASSWORD') WHERE user='root'; FLUSH PRIVILEGES;6. Restart the MySQL service.
service mysql restart
source:
$link[host]
Read Original Source