View Full Version : Unable to connect to database server!
outerreaches
7-26-04, 08:11 AM
Our server is up, but when I try to access our online catalog (which is MySQL & PHP driven) at the following link:
http://www.theouterreaches.com/catalog/default.php
It says 'Unable to connect to database server!'
Is MySQL down?? I'm on venus, and it was working last night when I went to bed. I didn't touch anything and it is just down all of a sudden... :confused:
I'm having similar issues at http://curran.ca
Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /www/c/curran/*/*/*/databases/mysql.class.php on line 108
Cannnot connect to DB server
I switched users - no change. I can connect to my database with phpMyAdmin with no problem - what's up? the site was fine last night at 1:30 pm.
Which SQL servers are you two using? There are lots of them.
But if you can get to it with phpMyAdmin, then the server itself is ok.
outerreaches
7-26-04, 12:15 PM
Sorry, should have posted that. I checked our OPS and our mySQL database is hosted on PowWeb's server terra.powweb.com.
I can access it through phpMyAdmin :confused:
But I made no changes at all between last night and now. So why would it all of a sudden not be able to connect to the database server?
Could be the config file is corrupt. Check what is in your config file just to be sure, and try to upload a new copy.
outerreaches
7-26-04, 01:16 PM
How could the config file get corrupted all of a sudden when nothing was done to it?
TheFiniteMonkey
7-26-04, 03:04 PM
Same problem here, with a different twist. My domain is thefinitemonkey.com, and I run two scripts that use mySQL, one for a blog, and one for a forum. The blog script is MovableType (2.661) and the forum script is phpBB (2.0.6). The blog stuff is still working fine, and I can access the db through phpMyAdmin but the forum no longer works. I have *not* changed or modified anything since the last time I saw it working. Here's the error message I get when I try to load the forum:
Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/tmp/mysql.sock' (2) in /mypath/htdocs/db/mysql4.php on line 48
Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource
in /mypath/htdocs/db/mysql4.php on line 330
Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource
in /mypath/htdocs/db/mysql4.php on line 331
phpBB : Critical Error
Could not connect to the database
My site and mySQL server are hosted on terra.powweb.com.
Its possible the local socket file is no longer working. This tends to happen more often then the mysql server's tcp port not working, I think this is because it is in the /tmp directory which pretty much allows any user to do anything in there.
I restarted mysql on terra. To avoid this problem in the future, set you mysql hostname to "terra.powweb.com" instead of localhost.
thats good to know... thanks James...
TheFiniteMonkey
7-26-04, 09:42 PM
Thanks, James. I'm not sure if it was before or after you restarted mySQL, but someone in Support Chat who was able to see my board even though I was still getting errors, suggested I try clearing my cookies and/or cache. I deleted my cookie for the board, and then things worked again. Don't quite get why it worked, but it did. I'll go and adjust the hostname per your suggestion, too, just to be safe.
I am on terra as well. I changed localhost to terra.powweb.com in the connection string - and now it works. It has been localhost for a couple of years now ...
Just checked the thread when I got home - but I had fixed it this morming.
Ciaran Wills
7-28-04, 02:58 PM
I've just had the same problem on io.powweb.com - changing the database host from localost fixed it. This has happened before too - what's going on? Why doesn't localhost connect to the database?
BlueSite
7-28-04, 03:06 PM
im having a problem connecting to. im trying to install WORDPRESS, and i have my info in correctly
$server = 'mysql04.powweb.com';
$loginsql = 'jboze3131';
$passsql = 'xxxxx';
$base = 'bluesite';
i had it set to localhost too, but it didnt work. i made a new user and tried it, it didnt work either.
tazmiller
8-19-04, 11:36 AM
I too am having this problem :
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
the server I am on is mysql03.
james is it possible to do what you did above to rectify this?
Thanks
your database might be on mysql03 but your script is not. It shouldn't try using the local socket "/tmp/mysql.sock" unless your telling it to use localhost. There isn't anything to fix, mysql03 is fine.
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.