-   Slackware (
-   -   Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) (

Pode 11-25-2008 12:28 PM

Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)
When I want to open acetoneiso's homepage I get this messege:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)

root@PC1:/etc# ps -A | grep mysql
2733 ? 00:00:00 mysqld_safe
2765 ? 00:00:00 mysqld

I run
mysql_install_db --user=mysql

but solve the problem then i run these:

/etc/rc.d/rc.mysqld stop
rm -fR /var/lib/mysql/*
mysql_install_db --user=mysql
/etc/rc.d/rc.mysqld start

but nothing.

And I can't find mysql.sock file

Please help

keefaz 11-25-2008 01:09 PM

Maybe mysql runs fine (as shown with ps output)

Check it with mysql client:

mysql> status

Pode 11-25-2008 01:31 PM

Thank for reply
I get this:

mysql> status
mysql Ver 14.12 Distrib 5.0.51b, for slackware-linux-gnu (i486) using EditLine wrapper

Connection id: 1
Current database:
Current user: pode@localhost
SSL: Not in use
Current pager: stdout
Using outfile: ''
Using delimiter: ;
Server version: 5.0.51b-log Source distribution
Protocol version: 10
Connection: Localhost via UNIX socket
Server characterset: latin1
Db characterset: latin1
Client characterset: latin1
Conn. characterset: latin1
UNIX socket: /var/run/mysql/mysql.sock
Uptime: 1 hour 14 min 14 sec

Threads: 1 Questions: 4 Slow queries: 0 Opens: 12 Flush tables: 1 Open tables: 6 Queries per second avg: 0.001

keefaz 11-25-2008 02:21 PM

So, you see ? mysqld is running fine

Now what is "acetoneiso's homepage" ? how this page accesses to mysql ? with php ?
Have you set mysql root user password yet ?

mysqladmin -u root password "yourpassword"
mysqladmin -u root -h `hostname` password "yourpassword"

Didier Spaier 11-25-2008 02:30 PM

Maybe the connection is expected through http, not through a unix socket.

Try commenting the line :

e.g. write

in /etc/rc.d/rc.mysqld

then restart mysql:
/etc/rc.d/rc.mysql restart


keefaz 11-25-2008 02:41 PM

mysqld doesn't use port 80 (http) to communicate, it has its own port (generally TCP 3306)
I don't think open mysqld port will solve the issue here, but I don't know

Didier Spaier 11-25-2008 02:58 PM

After a little googling I suppose you are trying to connect to this page:

If that is the case the message you get has nothing to do with your own settings, it's a problem with the host of the website you are visiting (I get the same result).

So forget my former post and send a message about this problem to acetoneiso if you can reach him/her.

Pode 11-25-2008 02:58 PM

Acetoneiso homepage:

mysqladmin -u root password "yourpassword"
mysqladmin -u root -h `hostname` password "yourpassword"

I get :
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

Uncommenting the SKIP="--skip-networking" line don't help

Pode 11-25-2008 03:01 PM

thanks for helping

keefaz 11-25-2008 03:41 PM

For the password issue, you could reset it with:
(as root)

/etc/rc.d/rc.mysqld stop
mysqld_safe --skip-grant-tables &
mysqladmin -u root password "yourpassword"
mysqladmin -u root -h `hostname` password "yourpassword"

BTW, the mysql root user is not the same as your system root user, so try to use different password for mysql root user

Is hosted in your machine or it is an external server ?

Alien_Hominid 11-25-2008 04:12 PM

EDIT: How do you connect? You can't connect from external host using socket (mysql.sock I mean).

Pode 11-26-2008 04:17 AM is not hosted in my machine.
I just can't open the page long time and because that I was thinking that the problem is on my machine but Didier Spaier says he get same messege so there is nothing to do.
Thanks for helping.

Alien_Hominid 11-26-2008 08:21 AM

Sorry, but your local copy of mysql and the mysql error on that page are unrelated.

All times are GMT -5. The time now is 11:35 PM.