Ok for the benefit of anyone else who reads this, I followed the instructions from:
https://help.ubuntu.com/community/MysqlPasswordReset
First, I stopped the mysql daemon:
Code:
sudo /etc/init.d/mysql stop
then I restarted the mysql daemon process using the --skip-grant-tables option:
Code:
sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &
I then restart mysql client:
I then used this command from the mysql prompt to be able to change password:
I now reset password with:
Code:
SET PASSWORD FOR root@'localhost' = PASSWORD('xxxxxxxx');
where xxxxxxxx is my password.
The instructions now tell me that since I have a root account, I should use this command to be able to connect from anywhere:
Code:
UPDATE mysql.user SET Password=PASSWORD('newpwd') WHERE User='root';
Once you get a successful message, flush privileges:
Then stop and restart the mysql daemon:
Code:
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysql start
I then log into mysql with the following command:
Code:
glenn@acer:~$ mysql -u root -p
when it should ask you for a password. Once entered, you should be logged into mysql as root:
Code:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 49
Server version: 5.5.22-0ubuntu1 (Ubuntu)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
and testing, I again enter
Code:
glenn@acer:~$ mysql -u root -p
Enter password:
And I log into mysql.
Have I missed anything important out?
Bookmarks