I have MySQL 5.5.20 and this table:
mysql> desc country; +----------------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------------+-------------+------+-----+---------+-------+ | id | int(255) | NO | PRI | NULL | | | iso | varchar(2) | NO | | NULL | | | name | varchar(80) | NO | | NULL | | | printable_name | varchar(80) | NO | | NULL | | | iso3 | varchar(3) | YES | | NULL | | | numcode | smallint(6) | YES | | NULL | | +----------------+-------------+------+-----+---------+-------+
If I run a query like this
SELECT country.ID, country.ISO, country.NAME,
country.PRINTABLE_NAME, country.ISO3, country.NUMCODE
FROM country;
It returns:
ERROR 2013 (HY000): Lost connection to MySQL server during query
If I change the order of the columns (ISO3 before PRINTABLE_NAME for example) like this:
SELECT country.ID, country.ISO, country.NAME,
country.PRINTABLE_NAME, country.NUMCODE, country.ISO3
FROM country;
It works fine!
Or if I rewrite the query using lower-case letters for columns, it works as well.
This issue appears from time to time (about once a month) and the only solution to fix it is to restart MySQL! i have checked error log and nothing added to error log upon this error!! I am really confused and don't know why this happens! Any ideas on how this could be fixed?
-
yes... but nothing beneficial,,, it says: 130310 11:01:23 [Warning] /usr/sbin/mysqld: Forcing close of thread 401108 user: 'root'Alaa– Alaa2013年03月10日 16:11:53 +00:00Commented Mar 10, 2013 at 16:11
-
(Side note: please capitalize your "I"s. It's always written in uppercase in English, never "i".)Mat– Mat2013年03月10日 16:14:53 +00:00Commented Mar 10, 2013 at 16:14
-
1maybe a good time to update MySQL as you are hitting bugs with an old versionborrel– borrel2013年03月12日 01:51:43 +00:00Commented Mar 12, 2013 at 1:51
1 Answer 1
I am running MySQL 5.7.26 on Windows and when doing just a simple query from the MySQL command line client I get that same error you describing. I found out it only occurs when the query length is exact 64 characters! Just by adding a space fixed the problem for me.
It doesn't matter if it's a select or insert/delete/update query.
I have run 66.000 queries on my server and only the queries with exact 64 characters failed.
I checked the database for corruption. But I could also reproduce same problem when making a new database and table on that server.
I could only reproduce this problem on that production server. I created a new server with same version with exact same settings as a VMWare machine but could not recreate. Used the same MySQL client.