Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql client occasionally encounters errors #106

Open
yejr opened this issue Nov 30, 2022 · 1 comment
Open

mysql client occasionally encounters errors #106

yejr opened this issue Nov 30, 2022 · 1 comment

Comments

@yejr
Copy link

yejr commented Nov 30, 2022

mysql> show create table t1;
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| TABLE | CREATE TABLE                                                                                                                                                                                                                                                        |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t1    | CREATE TABLE `t1` (
        `id` bigint(11) NOT NULL AUTO_INCREMENT,
        `score` tinyint(4) NOT NULL,
        `grade` tinyint(4) NOT NULL,
        PRIMARY KEY (`id`),
        KEY `ig` (`grade`)
) ENGINE = InnoDB AUTO_INCREMENT = 12 DEFAULT CHARSET = utf8
PARTITION BY KEY(`id`)
PARTITIONS 8 |
+-------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> alter table t1 add age tinyint not null;
ERROR 2013 (HY000): Lost connection to MySQL server during query
No connection. Trying to reconnect...
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0
ERROR:
Can't connect to the server

mysql> alter table t1 add age tinyint not null;
No connection. Trying to reconnect...
Connection id:    3
Current database: d3

Query OK, 0 rows affected (3.63 sec)
@hustfxj
Copy link
Collaborator

hustfxj commented Dec 1, 2022

how much rows has the Table ? And you can check the params as follows:

cat /proc/sys/net/ipv4/tcp_keepalive_time
cat /proc/sys/net/ipv4/tcp_keepalive_intvl
cat /proc/sys/net/ipv4/tcp_keepalive_probes

Maybe the tcp close the idle connection due to the ddl take long time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants