Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

MySQL error /var/lib/mysql/mysql.sock

Discussion in 'Database Discussion' started by elias9, Dec 30, 2014.

  1. elias9

    elias9 Member

    Joined:
    Oct 30, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello

    mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    /home/thesymbi/public_html/includes/class_core.php on line 274

    I get this around 50 times a day!
    I am fed up !

    Please someone help me out urgently
     
  2. danrussell

    danrussell Well-Known Member

    Joined:
    Nov 5, 2014
    Messages:
    61
    Likes Received:
    3
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hi :),

    Firstly check the path of mysql.sock in /etc/my.cnf file on your server.
    Normally it is set as "socket=/var/lib/mysql/mysql.sock" (without quotes) under [mysqld] section.

    Then check if mysql.sock file present under /var/lib/mysql/, if not, then symlink the file which is in /tmp folder.

    For that, stop MySQL service first, then execute below command:

    ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock

    and then start MySQL.
     
  3. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,532
    Likes Received:
    1,966
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello :)

    Do you notice any errors in the MySQL error log when this occurs (/var/lib/mysql/$hostname.err)? Have you attempted to modify your /etc/my.cnf file based on tuner results?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. elias9

    elias9 Member

    Joined:
    Oct 30, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    the problem return again :(

    root@serv [~]# tail -10 /var/lib/mysql/serv.myhost.com.err
    2015-02-20 21:58:56 20542 [Note] InnoDB: Highest supported file format is Barracuda.
    2015-02-20 21:58:57 20542 [Note] InnoDB: 128 rollback segment(s) are active.
    2015-02-20 21:58:57 20542 [Note] InnoDB: Waiting for purge to start
    2015-02-20 21:58:57 20542 [Note] InnoDB: 5.6.22 started; log sequence number 2127359851
    2015-02-20 21:58:57 20542 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
    2015-02-20 21:58:57 20542 [Note] - '127.0.0.1' resolves to '127.0.0.1';
    2015-02-20 21:58:57 20542 [Note] Server socket created on IP: '127.0.0.1'.
    2015-02-20 21:58:57 20542 [Note] Event Scheduler: Loaded 0 events
    2015-02-20 21:58:57 20542 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.6.22' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
     
  5. elias9

    elias9 Member

    Joined:
    Oct 30, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Code:
    2015-02-21 01:51:46 16179 [Note] Plugin 'FEDERATED' is disabled.
    2015-02-21 01:51:46 16179 [Note] InnoDB: Using atomics to ref count buffer pool pages
    2015-02-21 01:51:46 16179 [Note] InnoDB: The InnoDB memory heap is disabled
    2015-02-21 01:51:46 16179 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
    2015-02-21 01:51:46 16179 [Note] InnoDB: Memory barrier is not used
    2015-02-21 01:51:46 16179 [Note] InnoDB: Compressed tables use zlib 1.2.3
    2015-02-21 01:51:46 16179 [Note] InnoDB: Using Linux native AIO
    2015-02-21 01:51:46 16179 [Note] InnoDB: Using CPU crc32 instructions
    2015-02-21 01:51:46 16179 [Note] InnoDB: Initializing buffer pool, size = 256.0M
    2015-02-21 01:51:46 16179 [Note] InnoDB: Completed initialization of buffer pool
    2015-02-21 01:51:46 16179 [Note] InnoDB: Highest supported file format is Barracuda.
    2015-02-21 01:51:46 16179 [Note] InnoDB: The log sequence numbers 2127359851 and 2127359851 in ibdata files do not match the log sequence number 2134996419 in the ib_logfiles!
    2015-02-21 01:51:46 16179 [Note] InnoDB: Database was not shutdown normally!
    2015-02-21 01:51:46 16179 [Note] InnoDB: Starting crash recovery.
    2015-02-21 01:51:46 16179 [Note] InnoDB: Reading tablespace information from the .ibd files...
    2015-02-21 01:51:47 16179 [Note] InnoDB: Restoring possible half-written data pages
    2015-02-21 01:51:47 16179 [Note] InnoDB: from the doublewrite buffer...
    2015-02-21 01:51:48 16179 [Note] InnoDB: 128 rollback segment(s) are active.
    2015-02-21 01:51:48 16179 [Note] InnoDB: Waiting for purge to start
    2015-02-21 01:51:48 16179 [Note] InnoDB: 5.6.22 started; log sequence number 2134996419
    2015-02-21 01:51:48 16179 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
    2015-02-21 01:51:48 16179 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
    2015-02-21 01:51:48 16179 [Note] Server socket created on IP: '127.0.0.1'.
    2015-02-21 01:51:48 16179 [Note] Event Scheduler: Loaded 0 events
    2015-02-21 01:51:48 16179 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.6.22'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)
    150221 01:55:43 mysqld_safe Number of processes running now: 0
    150221 01:55:43 mysqld_safe mysqld restarted
    150221 01:56:00 mysqld_safe mysqld from pid file /var/lib/mysql/serv.myhost.com.pid ended
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,532
    Likes Received:
    1,966
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. elias9

    elias9 Member

    Joined:
    Oct 30, 2014
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    MySQL failing

    Hello,


    mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    /home/thesymbi/public_html/includes/class_core.php on line 274

    I get this around 50 times a day!
    I am fed up !

    Errors Logs:

    root@serv [~]# tail -10 /var/lib/mysql/serv.myhost.com.err
    2015-02-20 21:58:56 20542 [Note] InnoDB: Highest supported file format is Barracuda.
    2015-02-20 21:58:57 20542 [Note] InnoDB: 128 rollback segment(s) are active.
    2015-02-20 21:58:57 20542 [Note] InnoDB: Waiting for purge to start
    2015-02-20 21:58:57 20542 [Note] InnoDB: 5.6.22 started; log sequence number 2127359851
    2015-02-20 21:58:57 20542 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
    2015-02-20 21:58:57 20542 [Note] - '127.0.0.1' resolves to '127.0.0.1';
    2015-02-20 21:58:57 20542 [Note] Server socket created on IP: '127.0.0.1'.
    2015-02-20 21:58:57 20542 [Note] Event Scheduler: Loaded 0 events
    2015-02-20 21:58:57 20542 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.6.22' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
    2015-02-21 01:51:46 16179 [Note] InnoDB: Starting crash recovery.
    2015-02-21 01:51:46 16179 [Note] InnoDB: Reading tablespace information from the .ibd files...
    2015-02-21 01:51:47 16179 [Note] InnoDB: Restoring possible half-written data pages
    2015-02-21 01:51:47 16179 [Note] InnoDB: from the doublewrite buffer...
    2015-02-21 01:51:48 16179 [Note] InnoDB: 128 rollback segment(s) are active.
    2015-02-21 01:51:48 16179 [Note] InnoDB: Waiting for purge to start
    2015-02-21 01:51:48 16179 [Note] InnoDB: 5.6.22 started; log sequence number 2134996419
    2015-02-21 01:51:48 16179 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
    2015-02-21 01:51:48 16179 [Note] - '127.0.0.1' resolves to '127.0.0.1';
    2015-02-21 01:51:48 16179 [Note] Server socket created on IP: '127.0.0.1'.
    2015-02-21 01:51:48 16179 [Note] Event Scheduler: Loaded 0 events
    2015-02-21 01:51:48 16179 [Note] /usr/sbin/mysqld: ready for connections.
    Version: '5.6.22' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL)
    150221 01:55:43 mysqld_safe Number of processes running now: 0
    150221 01:55:43 mysqld_safe mysqld restarted
    150221 01:56:00 mysqld_safe mysqld from pid file /var/lib/mysql/serv.myhost.com.pid ended


    Please someone help me out urgently
     
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice