Thread: Can't connect

    #1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    73
    Rep Power
    15
    Yes I've been to mysql.com but
    i'm still getting the error Can't connect to local MySQL server through socket /var/lib/mysql/mysql.sock (2)
    I checked the mysql.sock file and it is empty
    - any one got any idea whats happening - i have installed this on my machine at home and it works perfectly.

    Os Red Hat Linux 5.2

    thanks in advance
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    10
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by des:
    Yes I've been to mysql.com but
    i'm still getting the error Can't connect to local MySQL server through socket /var/lib/mysql/mysql.sock (2)
    I checked the mysql.sock file and it is empty
    - any one got any idea whats happening - i have installed this on my machine at home and it works perfectly.

    Os Red Hat Linux 5.2

    thanks in advance
    [/quote]

    Hi,

    If you can find file mysql.sock, and can't connect to mysql, it means that your client can't find the sock. Try calling the client with the option --socket=socket_path/mysql.sock .

    ex. mysql --socket=/usr/local/mysql/mysql.sock

    If it works, check the file /etc/my.cnf and change the [client] section so that the socket file is pointed to the same address as the socket in [mysqld] section.

    Please e-mail if I haven't been very clear.


    Bye,

    G.Bubani
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    73
    Rep Power
    15
    Hi,


    Hi G.Bubani

    Thank you for you reply - I have tried what you have said but it still doesn't connect. The mysql.sock that is there is empty (zero k). I have reinstalled but still nothing - can I get a mysql.sock file or is one created for each individual machine?

    thanks again for your help

    Des

    Ps I'm going to do another reinstall

  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    10
    Rep Power
    0
    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by des:
    Hi,


    Hi G.Bubani

    Thank you for you reply - I have tried what you have said but it still doesn't connect. The mysql.sock that is there is empty (zero k). I have reinstalled but still nothing - can I get a mysql.sock file or is one created for each individual machine?

    thanks again for your help

    Des

    Ps I'm going to do another reinstall
    [/quote]

    Hi Des,

    The file mysql.sock is a temporary file created as the deamon starts and is deleted as the daemon stops.

    Can you tell me where your mysql.sock is, and what permissions (owner, group, rxw) does the directory has so that I can think about what is going on ?

    Bye

    G.Bubani

  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    73
    Rep Power
    15
    Hi G.Bubani
    It looks for the file at
    /var/lib/mysql/mysql.sock

    but I have var/lib -but no mysql directory

    permissions for both var and lib are
    drwxr-xr-x

    thanks
    Des
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    73
    Rep Power
    15
    Apologies G.Bubani


    Please ignore last message I have a mysql directory in /var/lib/
    With permissions of drwxr-xr-x

    Thanks
    Des
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    73
    Rep Power
    15
    Hi G.Bubani

    Its a server problem I spoke with our server people and they have it working now.
    Thank you for all of your help
    Des

Similar Threads

  1. Can not connect to MySQL - urgent help required.
    By Husain in forum MySQL Help
    Replies: 17
    Last Post: April 5th, 2004, 09:39 PM
  2. how to connect to mysql on unix server?
    By virtualdub in forum Perl Programming
    Replies: 10
    Last Post: April 24th, 2003, 12:37 PM
  3. Can't use php to connect mysql
    By itsource in forum PHP Development
    Replies: 8
    Last Post: January 23rd, 2002, 01:16 AM
  4. No idea on how to connect to mySQL, please help
    By darthmahon in forum MySQL Help
    Replies: 1
    Last Post: January 7th, 2002, 05:31 AM
  5. MyODBC & Win98 / MySQL & RH 7.1: can't connect!!
    By jeffdking99 in forum MySQL Help
    Replies: 9
    Last Post: December 26th, 2001, 06:17 PM

IMN logo majestic logo threadwatch logo seochat tools logo