Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: mysql access loss
PostPosted: Sat Apr 25, 2009 2:00 pm 
Offline
Senior Newbie

Joined: Thu Aug 16, 2007 12:57 am
Posts: 13
Last night from literally one moment to the next, one refresh of viewing my online webcalendar app to the next, my server's php applications lost their connection to all my sql databases. I can't connect through Navicat, and none of the database applications (gallery, forums, calendar, etc) can reach their databases.

I made zero changes. Wasn't even in the server by SSH or ftp. Just viewing the pages through firefox.

I booted into my backup copy of my linode server, and everything works perfectly. I have no idea what could have instantaneously changed in my primary server to kill the connection, and am having no luck restoring it.

Is there any solution I can try, so I don't have to roll back to a backup that isn't as current as I would like?

Thank you.


Top
   
 Post subject:
PostPosted: Sun Apr 26, 2009 11:34 pm 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Did mysqld go down, perhaps? It's never happened to me AFAIK, but it's not beyond the realm of possibility.

You can manually check on your Linode whether your MySQL server is running and accepting connections using your webapp's credentials like so:

Code:
$ mysql --user=yourusername --pass=yourpassword
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.24a-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| foo                |
| test               |
+--------------------+
3 rows in set (0.10 sec)


Where yourusername and yourpassword can be found in your webapp's config somewhere.

The only other likely cause I can think of would be a firewall rule blocking access to port 3306. Possibly if you have some intrusion detection system set up, perhaps something set it off and caused it to block the port.


Top
   
 Post subject:
PostPosted: Mon Apr 27, 2009 12:12 am 
Offline
Junior Member
User avatar

Joined: Sat Mar 28, 2009 3:10 am
Posts: 22
Check the syslog as well - on many distributions this is /var/log/syslog or /var/log/messages. The logs will provide clues as to whether an error of some sort caused mysql to crash. Alternatively it might shed light on a situation where for some reason MySQL has used up all its connections.

You could filter for mysql messages by running 'grep mysql /var/log/syslog' to strip out uninteresting messages about other services running on the server.

Otherwise you could just try and restart mysql or even reboot the machine rather than a restoration from backup which should be pretty last resort.

Reading logs is your friend, this sort of thing is what they're there for :)


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group