Skip to content

Instantly share code, notes, and snippets.

@bcalloway
Created May 10, 2010 14:49
Show Gist options
  • Save bcalloway/396123 to your computer and use it in GitHub Desktop.
Save bcalloway/396123 to your computer and use it in GitHub Desktop.
Reset MySQL root password
mysql> update user set password=PASSWORD('') where user='root';
Query OK, 2 rows affected (0.03 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)
mysql> exit
Bye
Brandon-Calloways-MacBook-Pro-15:~ $ ps ax | grep mysql
769 ?? Ss 0:00.02 /bin/sh /usr/local/mysql/bin/mysqld_safe
820 ?? S 0:00.16 /usr/local/mysql/libexec/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --log-error=/usr/local/mysql/var/Brandon-Calloways-MacBook-Pro-15.local.err --pid-file=/usr/local/mysql/var/Brandon-Calloways-MacBook-Pro-15.local.pid
Brandon-Calloways-MacBook-Pro-15:~ $ sudo kill 820
Brandon-Calloways-MacBook-Pro-15:~ $ sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables &
[1] 7732
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[7783]: started
Brandon-Calloways-MacBook-Pro-15:~ $ sudo /usr/local/mysql/bin/mysqld_safe
[1] 8752
Starting mysqld daemon with databases from /var/lib/mysql
mysqld_safe[8773]: started
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment