Results 1 to 5 of 5

Thread: mysql broke during upgrade (ERROR 2002 (HY000): Can't connect to local ... socket)

  1. #1
    Join Date
    May 2007
    Beans
    86
    Distro
    Ubuntu 10.04 Lucid Lynx

    mysql broke during upgrade (ERROR 2002 (HY000): Can't connect to local ... socket)

    Hi,

    I recently updated from 8.04 to 10.04 and within the last release-upgrade (9.10 to 10.4) the system hang on setting up mysql. Now I am stuck with a broken mysql-server. When trying to connect I allway get
    Code:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
    I googled and tried a number of things to get it working:
    • manually set permission on /var/run/mysqld/mysqld.sock (user and groud: mysql)
    • remove the file and set permission for the directory
    • set a symlink on /tmp in the directory
    • completly remove (remove and autoremove) mysql-server and reinstall
    • manully choosing a different socket file (mysql -S ~/mysql.sock)
    • of course I tried rebooting the system, restarting the mysql process, etc..


    I am really stuck by now and I need this database. I have seen varios posts regarding this error, but nothing I tried helped and I haven't seen anything that explains why this happens.
    Maybe it's some stupid mistake, so if you can help, thanks a lot.
    Last edited by Jense; October 20th, 2010 at 11:53 AM. Reason: typo

  2. #2
    Join Date
    May 2007
    Beans
    86
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: mysql broke during upgrade (ERROR 2002 (HY000): Can't connect to local ... socket

    Just noticed too, that mysql seems not be running, at least
    Code:
    ps -A | grep mysql
    returns nothing. Trying to start the mysqld out of bin results in the following:
    Code:
    /usr/bin# mysqld
    101020 12:56:21 [Note] Plugin 'FEDERATED' is disabled.
    mysqld: Table 'mysql.plugin' doesn't exist
    101020 12:56:21 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    101020 12:56:21  InnoDB: Started; log sequence number 0 300962141
    101020 12:56:21 [ERROR] mysqld: unknown option '--skip-bdb'
    101020 12:56:21 [ERROR] Aborting
    
    101020 12:56:21  InnoDB: Starting shutdown...
    101020 12:56:22  InnoDB: Shutdown completed; log sequence number 0 300962141
    101020 12:56:22 [Note] mysqld: Shutdown complete
    
    root@zarafa-plugin:/usr/bin#

  3. #3
    Join Date
    May 2007
    Beans
    86
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: mysql broke during upgrade (ERROR 2002 (HY000): Can't connect to local ... socket

    So, after lots of searching I got it running again. Cost me nearly a day, so if anybody has problems, here is how I solved it:
    • purge and reinstall mysql server
    • chgrp -R mysql /var/lib/mysql/
    • Check if mysql can run in savemode: /usr/bin: mysqld_safe
    • Somehow I lost my mysql.conf for upstart. So recreate it and paste exec sudo -u mysql /usr/sbin/mysqld # <- important execute as use mysql

  4. #4
    Join Date
    Nov 2006
    Location
    Mentana (Rome), Italy
    Beans
    168
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: mysql broke during upgrade (ERROR 2002 (HY000): Can't connect to local ... socket

    Quote Originally Posted by Jense View Post
    Just noticed too, that mysql seems not be running, at least
    Code:
    ps -A | grep mysql
    returns nothing. Trying to start the mysqld out of bin results in the following:
    Code:
    /usr/bin# mysqld
    101020 12:56:21 [Note] Plugin 'FEDERATED' is disabled.
    mysqld: Table 'mysql.plugin' doesn't exist
    101020 12:56:21 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
    101020 12:56:21  InnoDB: Started; log sequence number 0 300962141
    101020 12:56:21 [ERROR] mysqld: unknown option '--skip-bdb'
    101020 12:56:21 [ERROR] Aborting
    
    101020 12:56:21  InnoDB: Starting shutdown...
    101020 12:56:22  InnoDB: Shutdown completed; log sequence number 0 300962141
    101020 12:56:22 [Note] mysqld: Shutdown complete
    
    root@zarafa-plugin:/usr/bin#
    The interesting part of that error is:

    101020 12:56:21 [ERROR] mysqld: unknown option '--skip-bdb'
    101020 12:56:21 [ERROR] Aborting

    it is sufficient to comment the skip-bdb instruction in my.cnf, et voilà, mysql starts again.

  5. #5
    Join Date
    Oct 2007
    Beans
    220
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: mysql broke during upgrade (ERROR 2002 (HY000): Can't connect to local ... socket

    I see you have it solved but when this happened to me recently, after an upgrade, the username and group for mysql was no mysql it was something else. So mysql was unable to start and I receive alot of errors.

    chown -R mysql:mysql /var/lib/mysql resolved the issue.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •