View Full Version : Can't connect to MySQL server all of a sudden
naborsapts
7-10-03, 10:56 PM
I've had YaBB SE installed on my Web site for a few weeks, and it's worked fine with no problems whatsoever until today, when all of a sudden I'm getting the following error
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /www/n/naborsapts/htdocs/wahi/yabbse/index.php on line 50
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) The problem started this morning, and I've checked a few times during the day, but the error continues. Haven't been able to access the forums at all!
Any suggestions on how I can fix this? Any ideas why YabbSE broke? Was there a change at PowWeb MySQL or PHP?
Here's some info about my installation of YaBB SE:
YaBB SE Version: 1.5.4
Link to Forum: http://www.washington-heights.us/yabbse/
Thanks!
naborsapts
7-10-03, 11:08 PM
And now I started getting the following problem on another PHP script I use: calendar.php:
Error: Connection to MySQL server 'localhost' failed.
Error: Connection to MySQL server 'localhost' failed.
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /www/n/naborsapts/htdocs/wahi/calendar/ltw_classes.php on line 59
Error: A problem was encountered while executing this query.
And my ad server stopped working as well: phpAdsNew.
There definitely seems to be a problem with PowWeb PHP -- anyone know what's going on? My Web site is fairly useless at the moment. I hope it can be fixed soon.
Thanks.
alphadesk
7-10-03, 11:19 PM
Change the "localhost" on all your scripts that use mysql to the actually mysql server ( asteroid.powweb.com ) if that is where your mysql server resides.
They will all work then.
naborsapts
7-10-03, 11:25 PM
Thanks Alpha!
Do you know why things changed? It'll take me a while to figure out how to do that for each of the scripts. I'd rather not have to do it, 'cause I just don't have the time. Will I be forced to? Or do you think they'll change it back to the way it was, and it's just a matter of waiting a few hours?
Thanks. :(
alphadesk
7-10-03, 11:37 PM
Or do you think they'll change it back to the way it was, and it's just a matter of waiting a few hours?Don't know for sure if asteroid has been moved over to the new system or not. If and when it is moved you will have to change them all to reflect your mysql server name not localhost. I have seen this happen even when mysql and the calling script are on the same server.
I never used localhost, always used server name, when setting up mysql scripts and never had this problem. Not once ;)
naborsapts
7-11-03, 12:06 AM
OK, I changed the MySQL database info to reflect the actual server name: asteroid.powweb.com
But now I get the following errors:
Warning: main(/Subs.php) [function.main]: failed to create stream: No such file or directory in /www/n/naborsapts/htdocs/wahi/yabbse/index.php on line 46
Warning: main() [function.main]: Failed opening '/Subs.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/n/naborsapts/htdocs/wahi/yabbse/index.php on line 46
Warning: main(/Errors.php) [function.main]: failed to create stream: No such file or directory in /www/n/naborsapts/htdocs/wahi/yabbse/index.php on line 47
Warning: main() [function.main]: Failed opening '/Errors.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/n/naborsapts/htdocs/wahi/yabbse/index.php on line 47
Warning: main(/Load.php) [function.main]: failed to create stream: No such file or directory in /www/n/naborsapts/htdocs/wahi/yabbse/index.php on line 48
Warning: main() [function.main]: Failed opening '/Load.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/n/naborsapts/htdocs/wahi/yabbse/index.php on line 48
Warning: main(/Security.php) [function.main]: failed to create stream: No such file or directory in /www/n/naborsapts/htdocs/wahi/yabbse/index.php on line 49
Warning: main() [function.main]: Failed opening '/Security.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/n/naborsapts/htdocs/wahi/yabbse/index.php on line 49
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /www/n/naborsapts/htdocs/wahi/yabbse/index.php on line 50
Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
YIKES!
Any suggestions?
Thanks.
alphadesk
7-11-03, 12:20 AM
YIKES!....is right. Don't know why that happened. Did you edit in notepad (word wrap off), upload ascii and chmod correct?
Never messed with yabb.
HELP YABBERS!
If all else fails change it back to localhost and see if all those errors go away.
RocketJeff
7-11-03, 12:30 AM
Originally posted by naborsapts
Do you know why things changed? It'll take me a while to figure out how to do that for each of the scripts. I'd rather not have to do it, 'cause I just don't have the time. Will I be forced to? Or do you think they'll change it back to the way it was, and it's just a matter of waiting a few hours?
Since most of the issues with 'localhost' started about the time they upgraded to mySQL version 4, I'm assuming that it's some change to the database itself.
Using 'localhost' always did uses a different communication method to talk with the database, so there might be some issues with that part of the code (haven't seen anything for sure, however).
I also have a YaBB SE forum on asteroid, and haven't had any trouble with it recently.
Since you changed "localhost" to "asteroid.powweb.com" It looks as if something went wrong with your upload of one or more of the YaBB SE files.
Try uploading the program files again, and make sure that the permissions are set correctly.
Check in ops to make sure that your MySQL database is still there.
And make a backup of your database quick before anything else goes wrong.
naborsapts
7-11-03, 10:44 AM
Hi!
The only thing I changed was "localhost" to the MySQL hostname: "asteroid.powweb.com"
I didn't touch any other code in the Settings.php file.
The steps I took:
* FTPed Settings.php to my computer in ASCII mode.
* Opened the file in Notepad with wordwrap OFF.
* Changed "localhost" to read "asteroid.powweb.com"
* Saved the file.
* FTPed the file back up to the server in ASCII mode.
Did I miss a step?
If it's a lost cause, can I get some tips on how to start over? How do I keep all the users (and their passwords) and posts, the templates that I labored so much over to get them just right, etc., when I reinstall YaBB SE (this time not using "localhost").
Before you do anything as drastic as a complete reinstall, try FTPing your settings.php file up one more time; sometimes mine have gotten corrupted during an upload. Uploading them again has fixed it every time.
Then go through the files in the yabbse directory and check to make sure that the permissions haven't changed mysteriously. That happens, too.
Then check in ops (ops.powweb.com) to make sure that your MySQL database is up and running.
I checked a minute ago, and my YaBBSE board on asteroid is running fine.
vBulletin v3.6.0, Copyright ©2000-2009, Jelsoft Enterprises Ltd.