02
Mar
2010
Grayside

How to Reset MySQL Root Password

Resetting the mysql root password shouldn’t have to happen. But every time it does, I go insane. This page is a set of notes detailing methods that have proven to work.

Archlinux

Taken from the archwiki.
1. Stop mysqld daemon
# /etc/rc.d/mysqld stop
# mysqld_safe –skip-grant-tables &
2. Connect to mysql server
# mysql -u root mysql
3. Change root password:
mysql&gt; <span class="caps">UPDATE</span> user <span class="caps">SET</span> password=<span class="caps">PASSWORD</span>(&#8220;NEW_PASSWORD&#8221;) <span class="caps">WHERE</span> User=&#8217;root&#8217;;
mysql&gt; <span class="caps">FLUSH</span> <span class="caps">PRIVILEGES</span>;
mysql&gt; exit

4. Then restart daemon:
# /etc/rc.d/mysqld restart
5. You’re done