Resetting mysql root password in Ubuntu Dapper
First you kill the running mysql server gracefully. The process id is grabbed from /var/run/mysqld/ and inserted into the kill statement. Note there are ticks around the process id, not single quotes.
Then the server is restarted with the permissions turned off, and the root user password can be changed.
Type this in terminal:
sudo su
kill `cat /var/run/mysqld/mysqld.pid`
mysqld --skip-grant-tables &
mysql -u root
UPDATE mysql.user SET Password=PASSWORD ('newpassword') WHERE User = 'root';
exit
kill `cat /var/run/mysqld/mysqld.pid`
mysqld &
mysql -u root -p
Enter your new password and you should be in.
Advertisements
Categories: DIY




mysqld –skip-grant-tables &
should read
mysqld -–skip-grant-tables &
That is what it said. I had it entered as code in html and it rendered funny. I changed it to pre and it looks right now.
Thanks for the tip.