Run this:
mysqld_safe --skip-grant-tables --user=root &
Then:
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
FLUSH PRIVILEGES;
Unfortunately, the info on the mysql site seems to be a bit wrong!
Run this:
mysqld_safe --skip-grant-tables --user=root &
Then:
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
FLUSH PRIVILEGES;
Unfortunately, the info on the mysql site seems to be a bit wrong!
It should be here:
/usr/bin/mysqld_safe
If not, try:
locate mysqld_safe
Remember though, you’ll have to be root to use this, or use sudo /usr/bin/mysqld_safe.
need double quotes around password and user:
UPDATE mysql.user SET Password=PASSWORD(“newpwd”) WHERE User=”root”;
as john mentioned above, you have to use sudo
Thanks John.
for newbies like me: you need to login to the mysql server before you can update the tables (#2 step). It will let you login without a password. Then restart it 🙂
Mine accepted single quotes v5 on debian etch. If i remember correctly i believe version 4 also accepts single quotes.