sysbench icon indicating copy to clipboard operation
sysbench copied to clipboard

Lost connection to MySQL server during query

Open BBJG001 opened this issue 4 years ago • 3 comments

I do the 'oltp_update_index' experiment of sysbench in kingshard. I encountered the following problem

(base) darcyzhang@debian:~$ sysbench /usr/share/sysbench/oltp_update_index.lua \
> --mysql-host=192.168.5.217 \
> --mysql-port=9696 \
> --mysql-user=root \
> --mysql-password=root \
> --mysql-db=test_db \
> --threads=16 \
> --events=1000000 \
> --report-interval=1 \
> --time=10 \
> run
sysbench 1.0.18 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 16
Report intermediate results every 1 second(s)
Initializing random number generator from current time


Initializing worker threads...

Threads started!

FATAL: mysql_stmt_execute() returned error 2013 (Lost connection to MySQL server during query) for query 'UPDATE sbtest1 SET k=k+1 WHERE id=?'
FATAL: `thread_run' function failed: /usr/share/sysbench/oltp_common.lua:458: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query
FATAL: mysql_stmt_execute() returned error 2013 (Lost connection to MySQL server during query) for query 'UPDATE sbtest1 SET k=k+1 WHERE id=?'
(last message repeated 1 times)
FATAL: `thread_run' function failed: /usr/share/sysbench/oltp_common.lua:458: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query
FATAL: mysql_stmt_execute() returned error 2013 (Lost connection to MySQL server during query) for query 'UPDATE sbtest1 SET k=k+1 WHERE id=?'
FATAL: `thread_run' function failed: /usr/share/sysbench/oltp_common.lua:458: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query
FATAL: mysql_stmt_execute() returned error 2013 (Lost connection to MySQL server during query) for query 'UPDATE sbtest1 SET k=k+1 WHERE id=?'
FATAL: `thread_run' function failed: /usr/share/sysbench/oltp_common.lua:458: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query
(last message repeated 1 times)
FATAL: mysql_stmt_execute() returned error 2013 (Lost connection to MySQL server during query) for query 'UPDATE sbtest1 SET k=k+1 WHERE id=?'
FATAL: `thread_run' function failed: /usr/share/sysbench/oltp_common.lua:458: SQL error, errno = 2013, state = 'HY000': Lost connection to MySQL server during query

(base) darcyzhang@debian:~$ sysbench
sysbench 1.0.18 (using system LuaJIT 2.1.0-beta3)

and my ks.yaml as follow

nodes :
-
    name : node1

    # default max conns for mysql server
    max_conns_limit : 32

    # all mysql in a node must have the same user and password
    user :  root
    password : 123456

    # master represents a real mysql master server
    master : 192.168.5.217:3396

    # slave represents a real mysql salve server,and the number after '@' is
    # read load weight of this slave.
    #slave : 192.168.59.101:3307@2,192.168.59.101:3307@3
    down_after_noalive : 32

# schema defines sharding rules, the db is the sharding table database.
schema_list :
-
    user: root
    nodes: [node1]
    default: node1
    shard:
    -
-
    user: kingshard
    nodes: [node1]
    default: node1
    shard:
    -

BBJG001 avatar Dec 05 '21 10:12 BBJG001

there is no problem when do sysbench test in db direcotry.

BBJG001 avatar Dec 05 '21 10:12 BBJG001

@BBJG001 Were you able to solve this?

Anjali05 avatar Jul 29 '22 17:07 Anjali05

use mysql;
SHOW VARIABLES LIKE '%timeout%';

@BBJG001 take a look at your timeout values on mysql.

gnumoreno avatar Aug 15 '22 18:08 gnumoreno