Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Apr 2003
    Posts
    555

    Default Error when running mysqldump

    Can someone tell me why the following error comes up when trying to run mysqldump in shell?

    -su-2.05b$ php ./db_backup.php
    mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (61) when trying to connect

  2. #2
    Member casey's Avatar
    Join Date
    Jan 2003
    Location
    If there is trouble, it will find me
    Posts
    2,336

    Default

    Does /tmp/mysql.sock exist?

  3. #3
    Member
    Join Date
    Apr 2003
    Posts
    555

    Default

    Yes, it does exist.

  4. #4
    Member casey's Avatar
    Join Date
    Jan 2003
    Location
    If there is trouble, it will find me
    Posts
    2,336

    Default

    What are the permissions on it?

  5. #5
    Member
    Join Date
    Apr 2003
    Posts
    555

    Default

    srwxrwxrwx 1 mysql wheel 0B Dec 31 01:58 mysql.sock

  6. #6
    Member casey's Avatar
    Join Date
    Jan 2003
    Location
    If there is trouble, it will find me
    Posts
    2,336

    Default

    What user are you running the script as?

  7. #7
    Member
    Join Date
    Apr 2003
    Posts
    555

    Default

    I'm running it as a cPanel user account which has "normal" shell access enabled in WHM.

  8. #8
    cPanel Partner NOC cPanel Partner NOC Badge AndyReed's Avatar
    Join Date
    May 2004
    Location
    Minneapolis, MN
    Posts
    2,223

    Default

    Are you sure that mysql.sock exits in the /var/lib/mysql/ and in /tmp/
    I have seen many problems like that and solving this issue varies from one server to another.
    Andy Reed
    RHCE and CCNA
    ServerTune.com

Similar Threads & Tags
Similar threads

  1. Mysqldump error in VPS
    By jolly in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 11-15-2010, 12:13 PM
  2. Error running cpbackup: ls: reading directory .: Input/output error
    By BianchiDude in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 03-11-2008, 01:58 AM
  3. mysqldump+error:1033+Table xyz was created with a different version of MySQL.
    By madan.cpanelnet in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-01-2007, 08:28 PM
  4. MySQLDump Broken
    By feldon27 in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 01-18-2006, 04:59 PM
  5. mysqldump problem
    By fishfreek in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 05-07-2004, 06:31 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube