MySQL Forums
Forum List  »  Install & Repo

Re: Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (11)
Posted by: rapochsenbein
Date: March 20, 2005 03:27PM

Hi there

I finally managed to get my local mysql-server running! Maybe I can help you guys.
Everything I did actually, was changing the mysql.sock in the php.ini file and in the my.cnf file from /var/lib/mysql/mysql.sock to /tmp/mysql.sock. I actually think that I tried this method yet before and it didn't work, but anyway, this time it worked!
My configuration:

MySQL and PHP are built from source.
Server gets started as follows: /usr/local/mysql/bin/mysqld_safe --user=mysqlusr &

My /usr/local/php/php.ini:

-----
...
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket = /tmp/mysql.sock
...
-----


My /etc/my.cnf:
-----
[mysql.server]
user=mysql
basedir=/var/lib

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
user=mysqlusr
socket=/tmp/mysql.sock

[client]
socket=/tmp/mysql.sock
-----


Permissions:

/tmp/mysql.sock: 0 srwxrwxrwx 1 mysqlusr mysqlgrp 0 20. Mär 22:19 mysql.sock
/var/run/mysqld/: 4 drwx------ 2 mysqlusr mysqlgrp 4096 20. Mär 22:19 mysqld
/var/run/mysqld/mysqld.pid: 4 -rw-rw---- 1 mysqlusr mysqlgrp 5 20. Mär 22:19 mysqld.pid
/etc/my.cnf 4 -rwx--x--x 1 mysqlusr mysqlgrp 383 20. Mär 22:19 /etc/my.cnf


I think this was the important stuff.....
Hope I can help you. I know exactly how painful this problem is. I spent at least 10 hours working on it.....

Joedl

Options: ReplyQuote


Subject
Written By
Posted
Re: Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (11)
March 20, 2005 03:27PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.