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 fails - /tmp/mysql.sock error

Discussion in 'General Discussion' started by mudduck, Nov 16, 2007.

  1. mudduck

    mudduck Member

    Joined:
    Nov 23, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    151
    Hopefully there's someone still up out there that can help point me in the right direction....

    I'm getting the error:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)
    when trying to start mysql.

    I've checked the various directories and the file is there...

    #(virtual5)/tmp ->df -h
    Filesystem Size Used Avail Capacity Mounted on
    /dev/amrd0s1a 965M 90M 798M 10% /
    devfs 1.0K 1.0K 0B 100% /dev
    /dev/amrd0s1g 37G 5.5G 28G 16% /home
    /dev/amrd0s1d 1.9G 2.0M 1.7G 0% /tmp
    /dev/amrd0s1e 14G 8.3G 4.8G 64% /usr
    /dev/amrd0s1f 9.5G 817M 7.9G 9% /var
    devfs 1.0K 1.0K 0B 100% /var/named/dev
    procfs 4.0K 4.0K 0B 100% /proc

    [ No space problem in the /var or /tmp partitions ]

    #(virtual5)/scripts ->./restartsrv_mysql
    #(virtual5)/scripts -> [no return - no error message ]


    [ Checking for mysql.sock in its various locations... ]

    #(virtual5)/var/db/mysql/mysql ->ls -al mysql*
    -rwxrwxrwt 1 mysql mysql 0 Nov 16 00:05 mysql.sock

    #(virtual5)/var/db/mysql ->ls -al mysql.sock
    -rwxrwxrwt 1 mysql mysql 0 Nov 16 00:58 mysql.sock

    #(virtual5)/tmp ->touch msql.sock
    #(virtual5)/tmp ->chmod 1777 mysql.sock
    #(virtual5)/tmp ->chown mysql:mysql mysql.sock


    [ OK it seems to be there now... let's try again... ]


    #(virtual5)/scripts ->/usr/local/bin/mysql --no-defaults --force --user=root --host=localhost --password=[**password**] --database=mysql
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)

    [and the file's still there in the correct place with the correct permissions ]

    #(virtual5)/tmp ->ls -al mysql.sock
    -rwxrwxrwt 1 mysql mysql 0 Nov 16 00:17 mysql.soc

    [ Let's try this... ]

    #(virtual5)/scripts ->killall mysqld
    No matching processes were found
    #(virtual5)/scripts ->mysql -u root -p
    Enter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (38)

    [ Just to be sure --- ]

    #(virtual5)/tmp ->ls -al mysql.sock
    -rwxrwxrwt 1 mysql mysql 0 Nov 16 00:17 mysql.sock
    #(virtual5)/tmp ->cd /var/lib/mysql/mysql

    #(virtual5)/var/db/mysql/mysql ->ls -al mysql.sock
    -rwxrwxrwt 1 mysql mysql 0 Nov 16 00:05 mysql.sock
    #(virtual5)/var/db/mysql/mysql ->

    #(virtual5)/var/db/mysql ->cd /var/db/mysql
    #(virtual5)/var/db/mysql ->ls -al mysql.sock
    -rwxrwxrwt 1 mysql mysql 0 Nov 16 00:58 mysql.sock

    #(virtual5)/var/db/mysql ->cd /tmp

    #(virtual5)/tmp ->ls -al mysql.sock
    -rwxrwxrwt 1 mysql mysql 0 Nov 16 00:17 mysql.sock

    The file entry was in the /etc/my.cnf file, and I've removed it and tried to start mysql with just
    set-variable = max_connections=1000
    port = 3306
    safe-show-database

    in the file.


    I've tried resetting the root password, and also the running the /scripts/mysqlup --force command.

    I had been running the mysql 4.0 version... so I thought I'd move ahead and upgrade. So, I ran the Update Software from WHM after selecting 4.1 on the tweak page.

    I'm not sure why it appears that 4.0x was the package installed...

    CPAN.pm: Going to build C/CA/CAPTTOFU/DBD-mysql-4.005.tar.gz

    I will use the following settings for compiling and testing:

    cflags (mysql_config) = -I/usr/local/include/mysql -pipe
    embedded (mysql_config) =
    libs (mysql_config) = -L/usr/local/lib/mysql -lmysqlclient -lz -lcrypt -lm
    mysql_config (guessed ) = mysql_config
    nocatchstderr (default ) = 0

    nofoundrows (default ) = 0

    ssl (guessed ) = 0
    testdb (default ) = test

    testhost (default ) =

    testpassword (default ) =

    testsocket (default ) =

    testuser (default ) =


    Still the same error appears when I attempt to start mysql.

    Ran the /scripts/perlinstaller --force Bundle::DBD::mysql as directe by the WHM page.

    I haven't run buildapache yet... I think that would only lead to more confusion.

    Any ideas would be greatly appreciated.

    Jerry
     
  2. mudduck

    mudduck Member

    Joined:
    Nov 23, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    151
    Small Update

    Forgot to mention it - but I also tried...

    #(virtual5)/var/db/mysql/mysql ->/usr/bin/mysqld_safe --user=mysql
    /usr/bin/mysqld_safe: Command not found.

    Searched entire disk for mysqld_safe - not found.
     
  3. mudduck

    mudduck Member

    Joined:
    Nov 23, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    151
    Quoting Secret Agent 9http://forums.cpanel.net/showthread.php?t=36503&page=2)

    Seemed to have a very similar problem...

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

    I check for the mysql.sock in /tmp and it creates it right. After restarting MySQL, it disappears again. ..."

    I saw the same thing happen multiple times.

    I tried using a touch to create the mysql.sock and also the soft link.

    Strange...
     
  4. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,569
    Likes Received:
    45
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    /scripts/restartsrv_mysql --check will resolve the #2002 error. As for why the symlink keeps disappearing, I have no clue at the moment. What's the output of the mount command? What are the contents of /etc/fstab ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. mudduck

    mudduck Member

    Joined:
    Nov 23, 2005
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    151
    #(virtual5)/var/db/mysql ->mount
    /dev/amrd0s1a on / (ufs, local)
    devfs on /dev (devfs, local)
    /dev/amrd0s1g on /home (ufs, local, soft-updates)
    /dev/amrd0s1d on /tmp (ufs, local, soft-updates)
    /dev/amrd0s1e on /usr (ufs, local, soft-updates)
    /dev/amrd0s1f on /var (ufs, local, soft-updates)
    devfs on /var/named/dev (devfs, local)
    procfs on /proc (procfs, local)

    # Device Mountpoint FStype Options Dump Pass#
    /dev/amrd0s1b none swap sw 0 0
    /dev/amrd0s1a / ufs rw 1 1
    /dev/amrd0s1g /home ufs rw 2 2
    /dev/amrd0s1d /tmp ufs rw 2 2
    /dev/amrd0s1e /usr ufs rw 2 2
    /dev/amrd0s1f /var ufs rw 2 2
    /dev/acd0 /cdrom cd9660 ro,noauto 0 0

    Still working on the problem... I submitted a cPanel ticket and Todd's rebuilding mysql and apache right now.

    I'll try to pass on anything that comes out of this.
     
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