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.

MySQL Won't (Re)start

Discussion in 'Database Discussions' started by Alcan, Jul 19, 2011.

  1. Alcan

    Alcan Member

    Joined:
    Sep 25, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    [SOLVED] MySQL Won't (Re)start

    It all started when someone asked for InnoDB to be supported on the server. The MySQL installation showed that InnoDB wasn't available (as in, not disabled, but not available at all). After spending a ton of time searching the internet, I found that all of the cases involving cPanel was that InnoDB was simply disabled and needed to be enabled through my.cnf. I figured I just needed to reinstall MySQL. I first used the MySQL Upgrade option in WHM and later used SSH, both producing the same result (upgrade failed). And of course, MySQL won't start.

    Here are the errors I could find in the upgrade log (let me know if the entire log is needed):

    Code:
    ...
    
    Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
    Running 'mysqlcheck with default connection arguments
    /usr/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) when trying to connect
    FATAL ERROR: Upgrade failed
    
    ...
    
    Successfully reinstalled DBD-mysql-4.019
    1 distribution installed
    /usr/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
    Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
    Unable to reset root MySQL password. at /usr/local/cpanel/scripts/securemysql line 152.
    phpMyAdmin is up to date. Execute '/usr/local/cpanel/bin/updatephpmyadmin --force' to force an update.
    MySQL upgrade completed successfully
    
    ...
    
    I should also mention that there is nothing in the my.cnf file at this point and I renamed a my.cnf,v file to my.cnf,v.old which had stuff in it but didn't seem to affect the outcome of starting MySQL.

    The cPanel option to restart gave a vague error saying that "mysql is not running". Using "service mysql start" gives me:

    Code:
    Starting MySQL. ERROR!  Manager of pid-file quit without updating file.
    
    Searching for that led to some more (failed) solutions about removing locks checking for processes relating to MySQL (there were none) checking the log (I could find nothing remotely related to MySQL in /var/log), doing chown on /var/lib/mysql, among other things that I can't remember.

    Any other ideas?

    EDIT:

    I should also mention that doing "mysql" in SSH gives me:

    Code:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    
    And /var/lib/mysql/mysql.sock does not exist (which confirms that MySQL isn't running). There is enough disk space (which was another of the failed "solutions") though I tried creating a symlink into /tmp, still with no success.
     
    #1 Alcan, Jul 19, 2011
    Last edited: Jul 19, 2011
  2. Alcan

    Alcan Member

    Joined:
    Sep 25, 2010
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    The cPanel support system solved the problem. It turned out that the option skip InnoDB was originally there but removed. Then, when I tried to restart MySQL, it found that the InnoDB files were corrupt and so it wouldn't load. Backing up the corrupt files and removing them solved the problems.

    Thank you!
     
    #2 Alcan, Jul 19, 2011
    Last edited: Jul 19, 2011
Loading...

Share This Page