Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
dude..I recently installed FC3 on my system. I activated httpd,and mysqld. when I tried to run my web application (which was done using php scripts)..it showed this "can't connect to mysql.sock" error..
when i tried to run phpinfo.ph (that only contains phpinfo(); ) it displayed the details properly, so I guess my php is working well.
this is a mysql problem right? how do I fix this ?
another thing..I didn't have this back then with RH9... and also, I got this error on a diferent system when I installed mysql, and I was able to fix it by turning down the firewall. This time, I didn't have to install mysql since I allready did it during intallation of the OS.
su to root, type the following:
service mysqld start
That should fix it.
To start the service automatically, you have to enable mysqld in the system tools -> services
I think the problem here is that your mysql client cannot find the file mysql.sock
(default path is /tmp/mysql.sock).
Then, you should find this file in /var/lib/mysql/mysql.sock
You can also change the setting in file /etc/my.cnf to set the path to mysql.sock as well.
Yes I also had the same problem last month. I searched for the file mysql.sock but it seems it is nowhere to be found in my system. I use FC3. Could anyone post out the mysql.sock contents so that i can make the file and put it in its right place.
You can't copy the contents of mysql.sock! It's a socket, not a normal file!
See the 's' at the start of:
"
srwxrwxrwx 1 mysql mysql 0 Mar 2 10:40 /var/lib/mysql/mysql.sock
"
If your php scripts specifiy the mysql hostname with something other than 'localhost', for example using the name '127.0.0.1', php will try to use TCP/IP. Then you don't have to worry about every setup putting mysql.sock in a different place.
However, in php.ini:
"
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =
"
Mine is blank, so it will use the built-in MySQL's defaults. You can change php.ini to have your actual socket in it. Everything works once you mess with the config files enough. You might try saving a backup before fiddling.
The main problem here is that the MySQL built into PHP has different settings to the MySQL server you have running.
I solved the problem allreday.. I forgot the permissions on /home directory, when I set it , then everything came to place.. It's probably the app that didn' t have the privilege on accessing some folders.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.