Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-09-2012, 02:24 PM   #1
Registered: Nov 2004
Posts: 136

Rep: Reputation: 20
lost root password mysql

after installing ubuntu perfect server 10.04
and everything was up and running after a few small tweaks with the email and ftp server i have just run up against a lost password for mysql. everything was working just fine on Wednesday but when i went to log into phpmyadmin as root yesterday i could not gain access. for some reason the root password has changed again for the second time once on the old server and once on the new server.

when trying to log into mysql command line i used this
root@server1:~# mysql -u root -p
and this is the output
root@server1:~# mysql -u root -p
Enter password:my password used during setup 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
so i am tried to change the root password for mysql i run this command

root@server1:~# sudo /etc/init.d/mysql stop
and this is the output of said command

root@server1:~# sudo /etc/init.d/mysql stop
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql stop

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) utility, e.g. stop mysql
i have searched google and have not come across an answer to this issue has anyone had this happen and how did you overcome it

Old 03-09-2012, 11:59 PM   #2
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917Reputation: 917
Maybe in your set-up process MySQL was set-up to listen on a different interface?
Try specifying your actual machine-name on the command-line.
Old 03-11-2012, 12:04 AM   #3
Registered: Nov 2004
Posts: 136

Original Poster
Rep: Reputation: 20
hhhmmm ok how would i do that? as far as i know nothing has changes all of the data bases are running ok and all of the sites are good. thanks for your reply

Old 03-13-2012, 04:53 AM   #4
Registered: Aug 2011
Location: Croatia
Distribution: Debian 10/Ubuntu 20.04
Posts: 64

Rep: Reputation: 15
Did you create another user with a grant privileges ?
If so, try to login as this user.
You may check your users with command:
mysql> select host, user, password from mysql.user;

However, passwords are encrypted and you will not see plain text passwords.
If your another user has enough privileges run:
mysql> mysqladmin -u root password NEWPASSWORD

If you can't do it, try this:


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lost MySQL password JavaNinja Linux - Software 3 01-28-2009 03:40 PM
Lost mysql root password on slack server iiKster Slackware 6 12-29-2008 06:30 PM
Lost of mysql root password satimis Linux - Server 6 12-06-2007 10:05 PM
mysql root password lost nazir Linux - Software 6 10-09-2007 11:18 AM
lost mysql password, can't recover slackhack Linux - Software 1 12-03-2005 06:15 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration