LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   MySQL Server Linux, CentOS VPS - Lost connection to MySQL server during query (https://www.linuxquestions.org/questions/linux-newbie-8/mysql-server-linux-centos-vps-lost-connection-to-mysql-server-during-query-910726/)

snooze1 10-28-2011 11:09 PM

MySQL Server Linux, CentOS VPS - Lost connection to MySQL server during query
 
Hello,

I have setup a small MySQL server running on CentOS, Linux. It's running fine apart from I am getting "Lost connection to MySQL server during query" through the control panel that is connecting to it from another server.

I'm only using 75MB out of 512MB of RAM, just in case it matters. I have two servers connecting to the database, and they're both getting this error, the two servers are running on Windows Server 2008 and the MySQL VPS Server is running on Centos, Linux.

Below is the my.cnf
Code:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-innodb
max_connections = 500
key_buffer = 16M
myisam_sort_buffer_size = 64M
join_buffer_size = 1M
read_buffer_size = 1M
sort_buffer_size = 2M
table_cache = 1024
thread_cache_size = 64
wait_timeout = 1800
connect_timeout = 360
max_allowed_packet = 126M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
query_cache_size = 32M
query_cache_type = 1

[mysqld_safe]
err-log=/var/log/mysqld.log
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 126M

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

[mysql.server]
user=mysql


Toggan 10-28-2011 11:30 PM

My suggestion would be to enable MySQL slow query logs and see if the remote page is timing out waiting for the query to return a result. You may also want to use the EXPLAIN command in the local MySQL instance to get more information about the query itself, that way, you can ensure it's as efficient as possible.

snooze1 10-29-2011 12:18 AM

Quote:

Originally Posted by Toggan (Post 4510982)
My suggestion would be to enable MySQL slow query logs and see if the remote page is timing out waiting for the query to return a result. You may also want to use the EXPLAIN command in the local MySQL instance to get more information about the query itself, that way, you can ensure it's as efficient as possible.

That's the hard part, it's TCAdmin so I didn't code it so I have no idea what's wrong, which is unfortunate. I'll demo that and then post back with the results, I have no clue what command it's actually sending to return that.

snooze1 10-29-2011 03:01 AM

Alright I added this to the my.cnf
Code:

log_slow_queries=/var/log/mysqld.slow.log
long_query_time=2

So far it hasn't logged anything, been running for just over two hours.


All times are GMT -5. The time now is 11:36 PM.