Reset root password for MySQL on Ubuntu

Stop the MySQL Server.

sudo /etc/init.d/mysql stop<br>

Start the mysqld configuration.

sudo mysqld --skip-grant-tables &<br>

Login to MySQL as root.

mysql -u root mysql<br>

Replace YOURNEWPASSWORD with your new password!

UPDATE user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;<br>
< / >