Enter the following lines in your terminal. Stop the MySQL Server.
1 2 3 | sudo /etc/init.d/mysql stop |
Start the mysqld configuration.
1 2 3 | sudo mysqld --skip-grant-tables & |
Login to MySQL as root.
1 2 3 | mysql -u root mysql |
Replace YOURNEWPASSWORD with your new password!
1 2 3 4 5 6 7 | UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit; |