Web Hosting Talk







View Full Version : MySQL problem...


Cael
05-28-2001, 02:30 PM
Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)
in /home/sites/home/web/phpMyAdmin/lib.inc.php on line 170
Error

MySQL said:
Back


It's weird, I can connect through in telnet, but not with phpMyAdmin. Anyone can help me?

By the way, my user is having problem to use php scripts with MySQL. He said the scripts can't connect to the database. I have configured php to install with MySQL so I guess that's not a problem.

If you can help, please add me in ICQ #13580554 . I need to fix this as soon as possible.

Thanks in advance.

-Edward-
05-28-2001, 02:44 PM
Donovan,

Stop your current mysql pid. Then restart mysql you should find that fixes things.

- Ed

Cael
05-28-2001, 02:52 PM
I tried, many many times. Useless...

Cael
05-28-2001, 02:53 PM
And please note, this is an error frm phpMyAdmin, not MySQL in telnet. I have no problem with MySQL in telnet.

-Edward-
05-28-2001, 03:01 PM
well when we got this error i did this -

/etc/rc.d/init.d/mysql stop

then

/etc/rc.d/init.d/mysql start

and phpmyadmin started up again.

Cael
05-28-2001, 03:03 PM
That's bad... 'cause I installed MySQL manually followed the Guide at uk2raq.com , and /etc/rc.d/init.d/mysql does not really work for me.

-Edward-
05-28-2001, 03:10 PM
only other ones i can suggest are -

safe_mysqld stop

and

safe_mysqld start

------

killall safe_mysqld

safe_mysqld start


those are the only other ones ive ever used.

Cael
05-28-2001, 03:12 PM
That's the method I used to restart mysql.

killall mysqld
killall safe_mysqld

-Edward-
05-28-2001, 03:14 PM
reboot your server then try starting mysql again.

Cael
05-28-2001, 03:15 PM
Did so before and nothing change.

-Edward-
05-28-2001, 03:23 PM
sorry dont know what else to suggest.

Cael
05-28-2001, 03:25 PM
T_T ...

By the way, can you tell me how to remove MySQL? I installed them manually with .tar.gz file as I am having some problems with the .pkg files.

Cael
05-28-2001, 03:40 PM
1 hour 12 posts. Hehe... Nice record. But I still need answers for my problem. I need to know how to remove MySQL. Please help...

iplexx
05-28-2001, 04:29 PM
as far as i can remeber we had the same problem some months ago. i think the fix was doing a chmod root:root mysql.sock but I'm not sure because we tried around with Cobalt's package before we decided to install the newest rpm.... just give it a try.

swissmonk
05-29-2001, 08:21 AM
Verify that the file mysql.sock is at the place specified: /var/lib/mysql/mysql.sock,

If not change your php.ini with the correct path to your mysql.sock

(mysql.default_socket = path/to/your/mysql.sock)

TheRazor
05-29-2001, 08:41 AM
If I am not mistaken mysql.sock is created each time you start mysql, so my thinking is if the file is corrupted it may be causing all sorts of probss. So try this

1) stop mysql

2) copy mysql.sock to a new directory or offline (in case I am wrong)

3) delete it and the link (make sure you do both)

4) then restart mysql using safe_mysql start

5) I believe that will recreate the mysql.sock file then try phpMyAdmin.

Hope it helps, and works

huck
05-29-2001, 10:54 AM
The Razor is on the right track....

You need to look at your my.cnf file.
This should be in /etc/ .... e.g. /etc/my.cnf

There should be a line near the top called socket which points to the mysql.socket file. Make sure this line is pointing to your mysql.socket file. You can put it in something like /var/lib/mysql or other locations. You then need to make sure the mysql.socket file exists and has permission of 755. The mysql.socket file does not actually contain anything, so you can create it with

touch mysql.socket
chmod 755 mysql.socket

make sure the my.cnf points to this file and that you create it as root.

Restart mysql and try your connections.

(I had the same problem with a PERL script; sometimes MySQL does not put the mysql.socket file in the right location, so you have to do it manually)

Cael
05-29-2001, 01:05 PM
/usr/local/mysql/share/mysql/my-small.cnf
/usr/local/mysql/share/mysql/my-medium.cnf
/usr/local/mysql/share/mysql/my-large.cnf
/usr/local/mysql/share/mysql/my-huge.cnf


Maybe you guys can help me to choose the right one?

huck
05-29-2001, 02:06 PM
You need to copy one of these into the /etc directory and rename it my.cnf. I would use my-medium.cnf, which is for machines with 128MB of RAM or more and running other programs, e.g. web server. Look at the top or each config file for more info. These files basically control startup options, e.g. memory usage, open handles, etc, for the mysql daemon. I use my-medium.cnf as default with most of our production servers. For a dedicated database, I would use my-large if you have enough RAM.

Cael
05-30-2001, 06:26 AM
Thanks guys!!! I have fixed it successfully!

Cool man... You are very helpful... Everyone of you. :)

By the way, if I put my.cnf file into /etc , will mysql start automatically each time the server reboots? Or I still need to do some tricks in /etc/rc.d/bla bla bla ?