Miscellaneous: MySQL: recovering lost mysql root password

(last edit: 2001-10-25) I had to replace the mysql root password because the guy that had it was on vacation wasn't picking up his phone. So after a bit of searching it turned out to be easier then anticipated. Just follow these 6 (or 7) easy steps as root and you'll be set in no time flat: 0. Kill the mysqld that may be running (not with -9) 1. /usr/local/bin/safe_mysqld --skip-grant-tables & 2. /usr/local/mysql 3. use mysql; 4. update user set password = password('.......') where user = 'root' and host='localhost'; (all one one line as one command.) 5. Stop mysql from command line with: mysqladmin -u root -p shutdown 6. start it again. (if you don't know how you can probably find clues in /etc/rc.local if you are using bsd Make pun not love! Sjoerd.

Click here to go back to the index.