SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2001
    Location
    Colorado
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql.sock and RedHat 7.1 rpm install



    I have a RedHat 7.1 system and am trying to get PHP4 to connect to MySQL through the web. I get the error: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (13) in /home/httpd/html/sql3.php on line 2
    Couldn't connect to server!

    So I went and looked at the configuration on MySQL and it shows the file 'mysql.sock' in the directory: /var/lib/mysql.

    My question is how do I change it to the '/tmp/' directory since PHP4 is looking for it there or change the config of MySQL without starting all over again with the source files rather than using the RPM install?

    Any help would be much appreciated!

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make a symbolic link from tmp to var like this

    At the bash prompt

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

    Damn RPMs I always opt to compile it myself for this very reason. And yes I have had the exact problem as you after installing an RPM and I used this solution, so let us know if it works for you.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Member
    Join Date
    May 2001
    Location
    Colorado
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think I got it, I used:
    ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

    and at least I am not getting database connection errors now.

    It's time to move on I think.

    Thanks again.


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
  •