MySQL Socket problem from Apache 1.3 and Php4
I am trying to do some local development on my site and have set up Apache 1.3, MySQL 4 and PHP4 under Fedora.
When I try to connect to the MySQL databases (which I havew confirmed are there and working with the username and pass used) Apache comes back with :L can;t connect to local MySQL server through socket '/tmp/mysql.sock (2)' why is this, MySQL is showing up in phpinfo? Where do I start? There is no mysql sock in /tmp/ I am guessing it gets created on some kind of initialisation. I have had this working on this machine before but since I have done stuff with Apache 2 and upgraded to Fedora from RH9. There is no firewall (just a thought :?) It could be conf for Apache 1.3 vs 2 and the version of php??? TIA Will.* |
If you want to use a socket then you will need to configure in the [mysqld] section of /etc/my.cnf
|
can u connect to mysql from bash? maybe mysqld is simply not running and u need to (re)start it.
cheers, j. |
I can connect and use mysql from bash.
I will check out my.conf Thanks for the hints. |
I can't find my.cnf in /etc/ ?
|
You need to copy the default one from the mysql tarball or create one from scratch if memory serves me correct..
try adding this in my.cnf, and make sure it has read/write access to the file.. [client] socket = /path/to/mysqld.sock |
That is great, I have located my-large and my-small cnf files in my tar ball.
This is making more sense. Since my system doesn't have a global cnf I tried to use my-small.cnf as /etc/my.cnf and left the default socket listing but now get the same issue as the php/apache call: Code:
[root@stardot support-files]# mysql -u stardotstar -p TIA Will; |
as far as i know the server creates the socket while starting. i would try a different directory than the /tmp but im not sure whether or not this is the point. on my box the socket resides in /var/lib/mysql. edit the my.conf to create the socket elsewhere.
maybe someone else has a better idea... do u start mysqld thru /etc/init.d or mysqld_safe? if not try one of these options. cheers,j |
Just make sure mysql has write and read conditions in tmp, if you want the file there...
try setting the sticky bit on tmp |
I have somehow got this untangled but still confused;
Basically I can't get MySQL to put the sock in /tmp/ I have edited php.ini to look to /var/lib/mysql/mysql.sock So, the local php.ini variables are pointing to the right place but the Global is still saying /tmp/ I will post some details from phpinfo and some other findings later if anyone can help me untange my configs. Thanks guys! Will Perseverance and forums have paid off as always :) |
You need to restart apache for changes made in php.ini to take effect,
Make sure you have changed my.cnf to point to the same location http://dev.mysql.com/doc/mysql/en/Pr...ysql.sock.html |
All times are GMT -5. The time now is 10:45 AM. |