error establishing database connection every day at the same time.

Status
Not open for further replies.

heretolearn

Active Member
31
2013
6
0
Hi!

Im getting this error every day at the same time. On kloxo side and on wordpress.wp-admin area has the same error.
Only thing what fixes it is vps restart.
I run kloxo + linux.
I have optimized mysql tables and repaired them.
Some of my wordpress tags are also gone, the first 20 tags are there, but as i browse the second page nothing comes up.
I thought, maybe i should just wait till the new version of wordpress is being released (that i could just reinstall everything and it might solve everything), but well, this could be serious MYSQL problem. So i thought i would ask here.
When it comes to my vps support, they don't solve those kinds of problems.

thank you.

Edit: Everything has been fixed.
 
Last edited:
36 comments
Who is your host so others may take note of there knowledge.

As for your situation it sounds to be that your mysql server peaks at a certain time and shuts down.
Its not easy to fix this as we will need more info. Please post your /etc/my.cnf here and also the mysql version.

Kloxo is a very bad panel as it runs on x86 centos 5 only and has way to many unneeded features.
 
vps6.net

Those can't be peak times because server goes down one time a day and the time frame is +-15 minutes day after day. So right now i can get my site up again with 2 minutes.

phpmyadmin 3.4.10
lighttpd/1.4.29
MySQL client version: 5.0.95
 
vps6.net

Those can't be peak times because server goes down one time a day and the time frame is +-15 minutes day after day. So right now i can get my site up again with 2 minutes.

phpmyadmin 3.4.10
lighttpd/1.4.29
MySQL client version: 5.0.95

This host is run by one guy, we were given 75% of his client base when the host was thinking of selling.

When i say peak time it can be cron jobs starting or php processes from your blog.

I will need to know what is in your /etc/my.cnf as these are your mysql configurations and you maybe have it limited which forces it to use more cpu instead of memory and causes it to shut down and/or take all resources.
 
Code:
vi /etc/my.cnf

then in the editor type
%y+
then press enter

this should open the file and copy all contents to clip board.
 
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

"then in the editor type %y+ then press enter"

those commands didn't work, or i just did something wrong.. i use putty.
 
Last edited:
Go back and do
Code:
vi /etc/my.cnf

then press the insert button on your keyboard...
Next place the cursor at the very first letter on the first line and hold the del button to remove all the lines

then copy this and right click on the ssh client to paste it into the file (give it a sec or 2 for it to paste it)

Code:
[mysqld]

# GENERAL #
user                           = mysql
old_passwords             = 1
socket                         = /var/lib/mysql/mysql.sock
pid_file                       = /var/run/mysqld/mysqld.pid

# MyISAM #
key_buffer_size                = 256M

# SAFETY #
max_allowed_packet             = 16M

# DATA STORAGE #
datadir                        = /var/lib/mysql/

# CACHES AND LIMITS #
tmp_table_size                 = 32M
max_heap_table_size            = 32M
query_cache_type               = 0
query_cache_size               = 0
max_connections                = 500
thread_cache_size              = 50
open_files_limit               = 65535
table_cache                    = 4096

Once you have pasted that into the file press the ESC button then type wq and press enter.

Now you can login to kloxo and restart mysql or restart your vps or run service mysqld restart
 
right now, i can't access kloxo or my site. the same error is up again.
I did just like you told me. Restarts don't help.
what should i do now?
thanks
 
Last edited:
[root@ ~]# /etc/init.d/mysqld restart
Stopping MySQL: [FAILED]
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]
It can't connect to mysql.
 
Reply to the pm so we can get this fixed ;)

edit: fixed your issue :P you pasted my config twice causing the server to fail to load.

I also made some minor edits as i noticed you have 2 gb ram so you should feel a much smoother speed when browsing your site.
 
Last edited:
are using any cache plugin if not use wp super cache which will decrease load on mysql server and serve static pages ;)

I don't use cache.
I never had that problem before, server worked 3 months, like a charm-no problems.
Until, my host had some DDOS's-abusers daily and server problems 2 weeks back. Now my server is broken because of that.
 
Ok I use vps6.net and there is no real support. But thier vps are usually very reliable since the last 6 months.



Check to see if you have any backups scheduled through kloxo. If they are scheduled around that time that is probably what is locking the database. I do not use lighttpd but apache and do not have those problems.


When it hangs have you tried to use ssh and service mysqld restart ??
 
Status
Not open for further replies.
Back
Top