Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Recently this has been happening every so often...say once a day for about 10 minutes. All the pages on my website load up as a blank page with big text DATABASE CONNECTION ERROR.

I try to login to my Phpmyadmin and my login does not work. After 10 minutes or so, my website is back and working, and i can also login to phpmyadmin

My website is a wordpress blog.

It is a dedicated server I am getting from WorldStream.nl

It runs on CentOS 5 with Apache.

I was told to look at logs, failures in logs, but I do not know how to retrieve these logs. My knowledge of SSH is limited to just Logging in and knowing how to restart apache (service httpd restart).

Anyone know what the deal is with my server...why is this happening, what can I do ??

share|improve this question
    
Time you learnt to find, read and understand your logs then. We can't do this for you. –  symcbean Nov 26 '10 at 10:21

2 Answers 2

up vote 1 down vote accepted

If you have that Error, log in via ssh and try:

mysqladmin -uroot -p processlist

Enter the password and look at the running processes. If your DB works and you see nothing odd, i would go on with the apache-logs. Try:

tail -f /var/log/httpd/error_log

BTW: In many cases phpmyadmin tells you something, if login doesnt work, like "Maximum Connections exceeded". Do you see any message? Do you see a page at all, or an empty page, or does it load until you get connection timeout from the Browser?

share|improve this answer
    
When I tried logging into phpmyadmin, I got the "Cannot log in to the MySQL server" error on the login page. –  Greatestswordsman Nov 26 '10 at 8:57

You can check the number of established database connections from the shell:

$ sudo netstat -anp | grep mysql | grep ESTABLISHED | wc -l

Try to login from the command line:

$ mysql -u root -pPassword

Even if the connection limit is reached, you can still login from the database server shell.

If you enabled logging in mysql, you can check the log file /var/log/mysql/mysql.log.

You can also use top to monitor your system processes and mtop to monitor your mysql server.

share|improve this answer
    
thanks, I believe i was able to locate the problem –  Greatestswordsman Nov 27 '10 at 23:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.