Description:
On trying to create a new user from mysql command line the command execution fails and the CLI clent loses connection with mysql server.
However on running a usual query again the connection is reestablished and command execution passes.
Note that it happens on some machines and is not repeatable on others, with the same version of mysql server, client and linux.
How to repeat:
[root@VCM-MME-2 ~]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.6.20 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| test |
| vcm_udb |
+--------------------+
4 rows in set (0.00 sec)
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select user, host, password from user;
+-------+----------------+-------------------------------------------+
| user | host | password |
+-------+----------------+-------------------------------------------+
| root | localhost | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| root | VCM-MME-2 | |
| root | 127.0.0.1 | |
| | localhost | |
| | VCM-MME-2 | |
| root | 10.10.0.154 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| monty | 192.168.10.154 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| root | 192.168.10.154 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| root | 192.168.10.153 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
+-------+----------------+-------------------------------------------+
9 rows in set (0.00 sec)
mysql> CREATE USER 'root'@'192.168.10.156' IDENTIFIED BY 'MontyPython';
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> CREATE USER 'root'@'192.168.10.156' IDENTIFIED BY 'MontyPython';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: mysql
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> select user, host, password from user;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: mysql
+-------+----------------+-------------------------------------------+
| user | host | password |
+-------+----------------+-------------------------------------------+
| root | localhost | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| root | VCM-MME-2 | |
| root | 127.0.0.1 | |
| | localhost | |
| | VCM-MME-2 | |
| root | 10.10.0.154 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| monty | 192.168.10.154 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| root | 192.168.10.154 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| root | 192.168.10.153 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
+-------+----------------+-------------------------------------------+
9 rows in set (0.00 sec)
mysql>
mysql>
mysql>
mysql> CREATE USER 'root'@'192.168.10.156' IDENTIFIED BY 'MontyPython';
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
mysql>
mysql>
mysql>
mysql> CREATE USER 'root'@'192.168.10.156' IDENTIFIED BY 'MontyPython';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: mysql
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
mysql>
mysql>
mysql> CREATE USER 'root'@'192.168.10.156' IDENTIFIED BY 'MontyPython';
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: mysql
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql>
mysql>
mysql>
mysql> select user, host, password from user;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1
Current database: mysql
+-------+----------------+-------------------------------------------+
| user | host | password |
+-------+----------------+-------------------------------------------+
| root | localhost | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| root | VCM-MME-2 | |
| root | 127.0.0.1 | |
| | localhost | |
| | VCM-MME-2 | |
| root | 10.10.0.154 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| monty | 192.168.10.154 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| root | 192.168.10.154 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
| root | 192.168.10.153 | *45F82D2D9C67635B6EFFB39D76081A750CE87AC7 |
+-------+----------------+-------------------------------------------+
9 rows in set (0.00 sec)
mysql>
mysql>
mysql> use mysql;
Database changed
mysql> quit
Bye
[root@VCM-MME-2 ~]# mysql --version
mysql Ver 14.14 Distrib 5.6.20, for Linux (x86_64) using EditLine wrapper
[root@VCM-MME-2 ~]# cat /proc/version
Linux version 2.6.32-358.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Fri Feb 22 00:31:26 UTC 2013
[root@VCM-MME-2 ~]#
[root@VCM-MME-2 ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN qlen 1000
link/ether 00:0c:29:9c:9c:bb brd ff:ff:ff:ff:ff:ff
inet 192.168.10.154/24 brd 192.168.10.255 scope global eth1
inet 192.168.10.170/24 brd 192.168.10.255 scope global secondary eth1:9
inet6 fe80::20c:29ff:fe9c:9cbb/64 scope link
valid_lft forever preferred_lft forever
3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN qlen 1000
link/ether 00:0c:29:9c:9c:c5 brd ff:ff:ff:ff:ff:ff
inet 127.0.0.2/32 brd 127.0.0.2 scope host eth2
inet6 fe80::20c:29ff:fe9c:9cc5/64 scope link
valid_lft forever preferred_lft forever
4: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UNKNOWN qlen 1000
link/ether 00:0c:29:9c:9c:cf brd ff:ff:ff:ff:ff:ff
inet 10.10.0.154/24 brd 10.10.0.255 scope global eth0
inet6 fe80::20c:29ff:fe9c:9ccf/64 scope link
valid_lft forever preferred_lft forever