31 August, 2009

Change the root password for the MySQL server - Ubuntu 9.04



If you need to reset your MySql root user password there is a simple way of doing so,

Firstly stop the MySQL server

sudo /etc/init.d/mysql stop

Then run this command:

sudo mysqld --skip-grant-tables &

Now change the user that you are accessing the SQL server with to root:

mysql -u root mysql

Enter the following command replacing the YOURWANTEDPASSWORD with whatever you want as a password:

UPDATE user SET Password=PASSWORD('YOURWANTEDPASSWORD') WHERE User='root'; FLUSH PRIVILEGES; exit;

now start the sql server again:

sudo /etc/init.d/mysql start

That is it the password is changed...

------------------------------------------
NOTE: These articles are tutorials/general ramblings. I do not except responsibility for anything that goes wrong, be it a broken HDD, an entire computer or if you chop off your arms, follow anything I say on this site at your own risk.
------------------------------------------

Comments



Leave a comment

Name:


URL:(optional)


Protection Number (Please insert in box below):7497


Comment:


This website was designed and implemented by myself, all opinions and views expressed are my own unless otherwise specified. Excluding the images contained within the header and any specified elsewhere on the site images are my own.

Copyright Rob Ward
2009 - 2010