LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   lost root password mysql (https://www.linuxquestions.org/questions/linux-software-2/lost-root-password-mysql-933636/)

kwickcut 03-09-2012 01:24 PM

lost root password mysql
 
after installing ubuntu perfect server 10.04
Code:

http://www.howtoforge.com/perfect-server-ubuntu-10.04-lucid-lynx-ispconfig-3
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
Code:

root@server1:~# mysql -u root -p
and this is the output
Code:

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)
root@server1:~#

so i am tried to change the root password for mysql i run this command

Code:

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

Code:

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
root@server1:~#

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



kwick

Tinkster 03-09-2012 10:59 PM

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.

kwickcut 03-10-2012 11:04 PM

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



kwick

resolv_25 03-13-2012 03:53 AM

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:
http://www.cyberciti.biz/tips/recove...-password.html


All times are GMT -5. The time now is 05:24 PM.