Page 1 of 1
Could not connect to database: Can't connect to local MySQL
Posted: Thu Jun 23, 2005 11:26 am
by Adam
Somebody HELP me..
Could not connect to database: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
I was searching everywhere but couldn't find the solution for this error.
Apache + PHP is working fine, MySQL is running (I checket by 'ps -A' & 'mysqladmin') however there is still this shit on my screen..
Posted: Thu Jun 23, 2005 12:24 pm
by Blazer
try restarting mysql so that it recreates the socket file in /tmp
Posted: Thu Jun 23, 2005 1:37 pm
by zoneminder
The problem is that your mysql installation and the php-mysql used by apache disagree about where the socket file is. You need to change one or the other so that they agree, or symlink the sock file so it appears in both locations.
If you google for your error message then you will many pages that explain this in more detail and which will probably be more helpful than here as it's not a ZM issue per se.
Phil
Posted: Thu Jun 23, 2005 1:41 pm
by Adam
I work on Ubuntu distro (based on debian), I symlinked it using: "ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock"
I'm not sure how to restart MySQL so I restarted my OS, however I'm still getting this error. Could You tell me what exactly should I do to change it?
THX 4 fast reply
Posted: Thu Jun 23, 2005 2:30 pm
by Baylink
I'm not sure you can symlink a socket; if they're on the same filesystem, try a hard link.
Posted: Mon Jun 27, 2005 11:11 am
by Adam
I fixed it, by adding --with-mysql-socket='path_to_mysql.sock' atribute while making './configure'
Now I have next problem, how to add web user and web group in apache:: 'apache' & 'apache'