Skip to content


Change Root Password MySQL

I don’t know how many times I have had to look up this information in the past. In hopes of learning-through-writing I’ve decided to publish these methods of recovering or resetting the MySQL root password. Set Initial Password If you’ve just installed MySQL and have never set the root password a password is not yet needed. Until one is defined you should be able to access your database(s) without the password. To set a password for the first time you can use: mysqladmin -u root password NEWPASSWORD Update Root Password If you want to update or change the existing root password you can use: mysqladmin -u root -p'oldpassword' password newpass You should note that this will require that you know the current password. Recover Lost Password If you have completely lost the MySQL root password and need to reset it you can. This will require short downtime on your database(s). Read more

MySQL Database Tables Read Only [SOLVED]

After typing out that title I wonder if I’ve been spending too much time on forums, hehe. In any case, I ran into a problem today regarding my database tables being read-only so I thought I’d post this for the good of the internets. I had to dig pretty deep to find a solution to it. Hopefully some additional Google fodder will make life a bit easier for the next guy. If you’re a regular reader here you know that I had some database problems this morning with this site. I ended up needing to import some databases from backups and manually tweak a few things to restore the lost data. Well it turns out that after a database import or a change of users and permissions your database tables can become read-only. I’m not entirely sure the reasoning behind this, but I found some discussion about it on a MySQL developers mailing list thread. Read more