Results 1 to 2 of 2

Thread: /var/lib/mysql/mysql.sock' (111) error.

  1. #1
    Join Date
    Jun 2004
    Posts
    87

    Default

    Try this first:

    service mysql stop
    rm -f /var/lib/mysql/mysql.sock
    service mysql start
    ln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock

    if fails :
    The the final solution is :

    I read a post at the eTech forum that the following needed to be in the /etc/my.cnf file:

    [mysqld]
    set-variable = max_connections=500

    [client]
    port = 3306
    socket = /tmp/mysql.sock
    [mysqld]
    port = 3306
    socket = /tmp/mysql.sock


    I only had the first 2 lines, so I added the [client] and [mysqld] parts.


    Then I shut down mysql and chkservd with the following commands:

    service mysql stop
    /etc/rc.d/init.d/chkservd stop


    Then I removed the following files:

    rm -rf /tmp/mysql.sock
    rm -rf /var/lib/mysql/mysql.sock


    Now restart mysql and chkservd with the following commands and mysql will create the mysql.sock file in the /tmp directory as oulined in the updated my.cnf file:

    service mysql start
    /etc/rc.d/init.d/chkservd start


    Now create the softlink with this:

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


    There were a couple of variations in that last last command to create the softlink. I guess it depends on where mysql creates the mysql.sock file when it starts. So if you are trouble shooting you might shut down mysql as shown above, then remove the mysql.sock files. Then restart mysql as shown above and see where it creates the mysql.sock file. If it creates it in the /tmp directory then you need the softlink command shown above. If it creates the mysql.sock file in the /var/lib/mysql directory then you problaby need to use the softlink command like this as shown in some of the other related posts:

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

  2. #2
    Join Date
    Jun 2004
    Posts
    87

    Default

    If you want to make sure which should be the valid symlink among the two below used widely.

    1. /tmp/mysql.sock

    2. /var/tmp/mysql.sock

    For the valid link used on the server among the above two, check the /etc/my.cnf file for follwoing line.

    " socket=/var/tmp/mysql.sock "

    You need to create the symlink for the socket mentioned in above line.

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
  •