DBD::mysql::st execute failed: Lost connection to MySQL server

jack2012

Member
Mar 16, 2012
7
0
51
cPanel Access Level
Root Administrator
Hi new to forum
i have a cp vps and i keep getting following emails every 4 hours

Cron <[email protected]> /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
---

DBD::mysql::st execute failed: Lost connection to MySQL server during query at /usr/local/cpanel/scripts/update_db_cache line 61.
DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at /usr/local/cpanel/scripts/update_db_cache line 63.

it all started with
cPanel ChkServd Service Monitor, spamd and then ftp and the latest was hang
so i done a forced update over several days and it cleared these problems
but now have the top topic error

i have read another simular post on here
http://forums.cpanel.net/f5/cron-ro..._db_cache-scripts-update_db_cache-156453.html
and i altered the following

"answer" Try raising any connection time outs in your /etc/my.cnf:

i cannot find this file only my.cnf.back which dont contain above but update_db_cache does so ive altered the following from and to
interactive_timeout 40 - 80
wait_timeout 8000 - 9000
connect_timeout 15 - 20

also edited the following


max_allowed_packet (default) - 128M

but no change
can anyone help out
im still learning so be gentle :)

many thanks

jack
 

tank

Well-Known Member
Apr 12, 2011
255
5
68
Chicago, IL
cPanel Access Level
Root Administrator
I highly doubt that this is a bug in cpanel... or else alot more people would be posting about this.

If I understand you correctly you cannot edit my.cnf at all?

The my.cnf is located in the /etc folder. Is this not seen at all?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello,

If you are the root administrator for SSH on the machine, then please run this command in root SSH:

Code:
ls -lah /etc/my.cnf
cat /etc/my.cnf
Thanks!
 

jack2012

Member
Mar 16, 2012
7
0
51
cPanel Access Level
Root Administrator
Ahh i found it

i opened it in nano and there is only 3 lines


[client]
user="root"
pass="n<****>f"

shouldnt there be alot more ?

regards
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Please post the return on both the commands I've noted, because it seems you've checked /root/.my.cnf rather than /etc/my.cnf file.
 

jack2012

Member
Mar 16, 2012
7
0
51
cPanel Access Level
Root Administrator
yes i see now
heres details

[email protected] [~]# ls -lah /etc/my.cnf
-rw-r--r-- 1 root root 684 Feb 28 2011 /etc/my.cnf
[email protected] [~]# cat /etc/my.cnf
# Optimized Configuration
[mysqld]
max_connections = 350
key_buffer = 64M
myisam_sort_buffer_size = 64M
join_buffer_size = 8M
read_buffer_size = 8M
sort_buffer_size = 4M
table_cache = 4000
thread_cache_size = 286
interactive_timeout = 50
wait_timeout = 8000
connect_timeout = 15
max_allowed_packet = 32M <--- ( isit this line needs altering to 125m ?)


max_connect_errors = 10
query_cache_limit = 16M
query_cache_size = 16M
query_cache_type = 1
tmp_table_size = 32M
skip-innodb
local-infile=0

[mysqld_safe]
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 32M <--- ( isit this line needs altering to 125m ?)

[myisamchk]
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M

[mysqlhotcopy]
[email protected] [~]#
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Hello,

You might want to bump up the values per whatever you believe you should use.

Please note that I am really confused by the entire thread. At one point, we were told about some myspeeddial icon and then later posted the contents of /root/.my.cnf rather than the clearly indicated /etc/my.cnf where I provided exact commands to run. If you had previously edited this file as your initial post stated, then the file's location would have been known. Also, you'd need to restart MySQL for any changes to take effect to that file (again, /etc/my.cnf).

Basically, if you need system administrative assistance due to having issues navigating the file system to revise files, I would highly suggest hiring someone to help out:

Sys Admin Services « Application Catalog

Unfortunately, we can only do so much here on the forums for assistance in understanding which files to edit and how to edit those files.

Thanks!