Losing connection when querying the database
Posted by: Patric Falinder
Date: January 09, 2014 07:43AM

Hi,

I have a MySQL 5.5 server installed on a Windows Server 2008 R2 64-bit host with 6 GB of RAM. I only have two databases on here, one is approximately 1 GB large and the other one is around 4.5 GB large.
I'm having trouble with the larger one and I can't seem to do a consistency check on it properly.

I run: mysqlcheck.exe -u root -p db_name

And after about 15 minutes I get this error message:
C:\Program Files\MySQL\MySQL Server 5.5\bin\mysqlcheck.exe: Got error: 2013: Lost connection to MySQL server during query when executing 'CHECK TABLE ... '

Also when I try to dump the database with this command:
mysqldump.exe -u root -p db_name > db_name.sql

I get this:
mysqldump: Error 2013: Lost connection to MySQL server during query when dumping table `tablename` at row: 17457397

At some points MySQL has crashed and I've been forced to start it up again.
When I executed this command on the server:
mysql> SHOW ENGINE INNODB STATUS;

I get this:

=====================================
140109 14:32:10 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 3 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 78 1_second, 78 sleeps, 7 10_second, 8 background, 8 flush
srv_master_thread log flush and writes: 78
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 7, signal count 7
Mutex spin waits 5, rounds 34, OS waits 0
RW-shared spins 7, rounds 210, OS waits 7
RW-excl spins 0, rounds 0, OS waits 0
Spin rounds per wait: 6.80 mutex, 30.00 RW-shared, 0.00 RW-excl
------------
TRANSACTIONS
------------
Trx id counter AC7625C
Purge done for trx's n:o < AC3ED01 undo n:o < 0
History list length 122
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started, OS thread id 8812
MySQL thread id 111, query id 1311 localhost ::1 root
SHOW ENGINE INNODB STATUS
---TRANSACTION AC7625B, not started, OS thread id 9164
MySQL thread id 144, query id 1310 localhost 127.0.0.1 name
---TRANSACTION AC7623C, not started, OS thread id 7932
MySQL thread id 142, query id 1263 localhost 127.0.0.1 name
---TRANSACTION AC7623B, not started, OS thread id 10156
MySQL thread id 133, query id 1204 localhost 127.0.0.1 name
---TRANSACTION AC7621C, not started, OS thread id 9872
MySQL thread id 131, query id 1157 localhost 127.0.0.1 name
---TRANSACTION AC7621B, not started, OS thread id 9376
MySQL thread id 122, query id 1098 localhost 127.0.0.1 name
---TRANSACTION AC761FC, not started, OS thread id 7156
MySQL thread id 120, query id 1051 localhost 127.0.0.1 name
---TRANSACTION AC761FB, not started, OS thread id 9820
MySQL thread id 102, query id 963 localhost 127.0.0.1 name
---TRANSACTION AC761CB, not started, OS thread id 6068
MySQL thread id 83, query id 753 localhost 127.0.0.1 name
--------
FILE I/O
--------
I/O thread 0 state: wait Windows aio (insert buffer thread)
I/O thread 1 state: wait Windows aio (log thread)
I/O thread 2 state: wait Windows aio (read thread)
I/O thread 3 state: wait Windows aio (read thread)
I/O thread 4 state: wait Windows aio (read thread)
I/O thread 5 state: wait Windows aio (read thread)
I/O thread 6 state: wait Windows aio (write thread)
I/O thread 7 state: wait Windows aio (write thread)
I/O thread 8 state: wait Windows aio (write thread)
I/O thread 9 state: wait Windows aio (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
2316 OS file reads, 11 OS file writes, 11 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 5, seg size 7, 0 merges
merged operations:
insert 0, delete mark 0, delete 0
discarded operations:
insert 0, delete mark 0, delete 0
Hash table size 1166359, node heap has 1 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 16199340211952
Log flushed up to 16199340211952
Last checkpoint at 16199340211952
0 pending log writes, 0 pending chkp writes
12 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 603111424; in additional pool allocated 0
Dictionary memory allocated 162587
Buffer pool size 35968
Free buffers 33790
Database pages 2177
Old database pages 823
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 2177, created 0, written 2
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s
LRU len: 2177, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread id 6016, state: waiting for server activity
Number of rows inserted 0, updated 0, deleted 0, read 145002
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================


And lastly this is my config.
my.ini:

[client]
port=3306

[mysql]
default-character-set=latin1

[mysqld]
port=3306
basedir="C:/Program Files/MySQL/MySQL Server 5.5/"
datadir="C:/ProgramData/MySQL/MySQL Server 5.5/Data/"
character-set-server=latin1
default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
max_connections=100
query_cache_size=186M
table_cache=1520
tmp_table_size=67M
thread_cache_size=38

myisam_max_sort_file_size=100G
myisam_sort_buffer_size=67M
key_buffer_size=29M
read_buffer_size=64K
read_rnd_buffer_size=256K
sort_buffer_size=256K

innodb_data_home_dir="E:/MySQL Datafiles/"
innodb_additional_mem_pool_size=23M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size = 11M
innodb_buffer_pool_size = 562M
innodb_log_file_size = 214M
innodb_thread_concurrency=8


log-output = FILE
general_log_file = mysql_general_log_new.log
log-error = "E:/MysqlLogerrors/err.log"


I wasn't the on who installed this and the person who did isn't working here anymore so I can't consult him and MySQL is not really my cup of tea.
Is there anyone who can help me here? What's the problem? Is it MySQL or is it the OS/hardware?
Anything that can help me here is appreciated. If you need more info just tell me.

thanks,
-Patric

Options: ReplyQuote


Subject
Written By
Posted
Losing connection when querying the database
January 09, 2014 07:43AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.