Web Hosting Talk







View Full Version : Cpanel/WHM and mySQL Problem


netrose
06-02-2001, 01:12 PM
Please help me guys. I have a RH 6.2 with Cpanel/WHM and I setup a database. But, when I try to connect to it through PHP I am getting this error:

Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) in /home/rosehost/public_html/dbfrontend/common.inc.php on line 18
A database connection error has occurred!

The php code I am using to connect is:

mysql_connect("localhost", "user_dbfrontent", "passwd")

All the data incl. usename, password and server is correct.

What is the problem and what do I need to do to fix it? Thanks.

superiorhost
06-02-2001, 01:49 PM
Hi,
I am thinking this may be a new install of cpanel/WHM...

Have you gone into the WHM and set a MySQL root password in the top area on the left menu?

Tim L :cool:

netrose
06-02-2001, 03:01 PM
Yes, I think I did. Anyway, I did it again. Does it matter?
Still the same error.

superiorhost
06-03-2001, 02:15 AM
Well,, from what it looks like, it is either password or permission problems. You might try setting the mysql root pass in shell...

I think this looks like an old error we heard about. I would contact the cpanel guys and see if it is an old bug that is back.

Tim L

Nicholas Brown
06-03-2001, 05:02 AM
Have you changed any of the Mysql config?
Was the Mysql Daemon Running?

netrose
06-03-2001, 09:46 AM
The daemon was running fine, the password was set properly. It was none of this. The problem was a missing file in /tmp. mysql expects to find mysql.sock in /tmp and that file was in another directory. I don't know if its a cpanel bug or not but it was installed that way. As soon as I created a symlink in /tmp it all worked right away. Thanks.

Bobi