The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Mysql can't connect to 'localhost' but '127.0.0.1' works fine?

Discussion in 'General Discussion' started by Miss Jacky, Mar 13, 2006.

  1. Miss Jacky

    Miss Jacky Well-Known Member

    Joined:
    Mar 4, 2004
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    Hi

    Mysql connection scripts can connect to the localhost IP 127.0.0.1 but our clients that use 'localhost' as their mysql host can't connect anymore.
    This problem started after problems with wrong group ownership of a lot of files server-wide.

    Any hints?

    tnx!
     
  2. WestBend

    WestBend Well-Known Member

    Joined:
    Oct 12, 2003
    Messages:
    173
    Likes Received:
    0
    Trophy Points:
    16
    i think /etc/hosts is what resolves localhost. You might want to check you have
    127.0.0.1 localhost in there.

    Also check the permissions of your /tmp directory and the ownership of :

    lrwxrwxrwx 1 root root 30 Mar 13 15:58 mysql.sock -> ../../var/lib/mysql/mysql.sock=
     
  3. Miss Jacky

    Miss Jacky Well-Known Member

    Joined:
    Mar 4, 2004
    Messages:
    91
    Likes Received:
    0
    Trophy Points:
    6
    Tnx for your reply!

    I found another thread with a mysql problem, and by adding public read and execute permissions on the /var/lib/mysql folder the problem is solved.

    have a nice day :)
     
Loading...

Share This Page