/usr/bin/mysqladmin: connect to server at 'localhost' failed

Linux.RedHat

Registered
Aug 17, 2010
3
0
51
Helllo !!!

when i make restart or update to mysql

this problem appears :

/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
mysql has failed, please contact the sysadmin (result was "mysql has failed").


and it faild now


Thanks ,,,,,,,,,,,,,,,,,,
 

prashant_ohol

Active Member
Nov 22, 2004
44
0
156
reset the mysql root pw

As root in shell,

mysqld_safe --skip-grant-tables --old-passwords &

mysql -u root -p <enter and add new pass>

Hope this helps,


Regards,
Prashant
 

Miraenda

Well-Known Member
Jul 28, 2004
243
5
168
Coralville, Iowa USA
cPanel Access Level
Root Administrator
Truly, the above steps aren't detailed enough to explain how to reset the root password for someone who might not know MySQL (and given the thread, that seems likely).

Here are detailed steps needed to fix the issue:

1. Disable MySQL Monitoring

Go to WHM > Service Manager and uncheck monitor for MySQL (so it doesn't restart while fixing the issue), then save the area

2. Stop MySQL in root SSH (if it is running, if not running at all, then this can be skipped)

Code:
/etc/init.d/mysql stop
3. Start MySQL without the password prompt

Code:
mysqld_safe --skip-grant-tables &
4. Get a copy of the current MySQL root password

Code:
cat /root/.my.cnf
Copy down what it shows for the password.

5. Log into mysql command line in root SSH and reset the password

Code:
mysql -u root
\u mysql
update user set password=("NEW-ROOT-PASSWORD") where User='root';
flush privileges;
quit
Please replace NEW-ROOT-PASSWORD above with the actual password copied from /root/.my.cnf earlier.

6. Restart MySQL and check it's working

Code:
/etc/init.d/mysql start
mysqladmin proc
If you can get a return of the processlist, it's working (not to mention it would have started properly at that point to show it's working).

7. Re-enable monitoring in WHM

Back in WHM > Service Manager, re-check monitor box for MySQL and save the area.
 
Last edited: