Re: Can't Connect to MySQL local Server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I had a similar problem the other day I think. plus many permission problems. But I got it work.

I added these two lines to the bottom of my /etc/my.cnf file

[client]
socket=/usr/local/mysql/mysql.sock

Just put in the path to your sock file and see if that helps.


ROGER DEBRY wrote:

Janet and Miles, Thank you for your suggestions.

Here is more information for you.
I am running:
Fedora core 5 Linux php 5.14
   apache 2.2.2
   mysql 5.0.22

I have added the mysql_error code to my script as you suggested.
I already knew the what the error was by looking in the error logs.
It is, "Can't connect to local MySQL server through socket
'/var/lib/mysql/mysql.sock' (13)"

I have run phpinfo, and it appears that MYSQL is enabled.
The MYSQL_SOCKET line in phpinfo( ) gives the path to the socket file
exactly as above.
I have checked and the socket is there with read and execute
permissions for everyone.
I did try to connect using 127.0.0.1 and got a similar error message,
  "Can't connect to MySQL server on '127.0.0.1' (13)"

I can connect to the server just fine at the command line with the
mysql client,
using the command     >mysql -hlocalhost -u<usename> -p<password>

The socket declaration in my.cnf is /var/lib/mysql/mysql.sock so it
matches
what php expects.

What other suggestions can you give to me?
Thank you.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux