kekays

Active Member
Nov 2, 2004
30
0
156
Kochin
cPanel Access Level
DataCenter Provider
Hi,

Mysql is running fine in our FreeBSD 4.11-STABLE server. I am getting error while accessing the site.which is a phpbb forum
---------------------------------------------------------------------------------------------------------------------------------
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/tmp/mysql.sock' (61) in /usr/home/username/public_html/db/mysql4.php on line 48

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /usr/home/username/public_html/db/mysql4.php on line 330

Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /usr/home/usernamepublic_html/db/mysql4.php on line 331
phpBB : Critical Error

Could not connect to the database
----------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------
#df -h
/dev/ad0s1a 1008M 265M 662M 29% /
/dev/ad0s1f 65G 18G 43G 29% /usr
/dev/ad0s1e 5.9G 1.2G 4.3G 22% /var
procfs 4.0K 4.0K 0B 100% /proc
/tmp 1008M 265M 662M 29% /var/tmp
---------------------------------------------------------------------------------------------------------------------------------
I cant change my /etc/my.cnf. Because all other sites and scripts are working based on that.
--------------------------------------------------------------------------------------------------------
#/etc/my.cnf
client]
socket=/tmp/mysql.sock

[mysqld]
set-variable = max_connections=2500
safe-show-database
socket=/tmp/mysql.sock
---------------------------------------------------------------------------------------------------
if i change the socket to

socket=/var/tmp/mysql.sock
the forum site will work............ but none of the scripts won't connect to database.
it won't work. Also we can't restart mysql from WHM. The satus will always shows failed. :(

Any help or suggestions will be greatly appreciated. Please help.............
 

kekays

Active Member
Nov 2, 2004
30
0
156
Kochin
cPanel Access Level
DataCenter Provider
I locate mysql.sock,

/usr/local/lib/mysql.sock
srwxrwxrwx 1 mysql wheel 0 Apr 25 18:06 /tmp/mysql.sock
srwxr-xr-x 1 root wheel 20 Apr 24 04:17 /var/tmp/mysql.sock -> ../../tmp/mysql.sock
i just create a link to /var/tmp/mysql.sock. but got thsi error message
ln: `/var/tmp/mysql.socki': File exists . So that i tried this with ln -fs. existing link overwrite. Bust still i have the same issue :( . anywone can help me,
Thanks in advance
 

kekays

Active Member
Nov 2, 2004
30
0
156
Kochin
cPanel Access Level
DataCenter Provider
Hi :)
After all i got solution. The issue was due to the /var/tmp is mounted to /tmp. i umount it forcefully and delete sock entry from my.cnf. After then i restart mysql..
-----------------------------------------------------------------------------------
#umount -f /var/tmp

# vi /etc/my.cnf
[mysqld]
set-variable = max_connections=2500
safe-show-database

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

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

Thank you All....... :D
 

electron33

Well-Known Member
Feb 24, 2004
90
0
166
Excellent :)

Thanks for letting us know how you finally resloved the problem.

I hate those posts that people get others involved and right in the end you see "problem solved".. and nothing else.