The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Database Discussions' started by Linux.RedHat, Aug 17, 2010.

  1. Linux.RedHat

    Linux.RedHat Registered

    Joined:
    Aug 17, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    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 ,,,,,,,,,,,,,,,,,,
     
  2. prashant_ohol

    prashant_ohol Active Member

    Joined:
    Nov 22, 2004
    Messages:
    44
    Likes Received:
    0
    Trophy Points:
    6
    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
     
  3. Miraenda

    Miraenda Well-Known Member

    Joined:
    Jul 28, 2004
    Messages:
    242
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Coralville, Iowa USA
    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.
     
    #3 Miraenda, Aug 18, 2010
    Last edited: Aug 18, 2010
Loading...

Share This Page