I am running mysql-client (Ver 14.14 Distrib 5.7.19) and mysql-server versions 5.7.19 with user root from localhost on Ubuntu server 16.04.2 LTS.

I have noticed that mysql doesn't return the data I'm asking unless I explicitly specify the database in the query. I have replicated the behavior below over and over again.

Can someone please explain why this is happening ?

use db1;
select database();

select count(*) from users;

select * from users;
    Empty set, 28416 warnings
select * from users;
    ERROR 2006 (HY000): MySQL server has gone away

The result is changing every time you run the query above. One empty set, one Error2006, one empty set, one Error2006,...

show warnings;
    ERROR 2013 (HY000): Lost connection to MySQL server during query
show warnings;
    Warning 1287 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead

There's 64 rows of this warning. I get Error2013 only the first time that I run "show warnings". There is no pause or delay. All subsequent runs return the same 64 rows.

select * from db1.users;

This returns the full table (145 rows) with no problems whatsoever.

  • You can specify the default database on the mysql client command line if you don't want tu use use. Same is true for most connector libraries. – eckes Sep 4 '17 at 15:28
  • Are there any long pauses around the time when it "lost connection"? – Rick James Sep 4 '17 at 17:26
  • 64 is the default limit on SHOW WARNINGS. (Better than getting flooded with 28416 lines of output.) – Rick James Sep 4 '17 at 17:30
  • Are there about 28416 rows in users? – Rick James Sep 4 '17 at 17:30
  • You say the "client" is 5.7.19; please verify. If using the command line tool, do mysql --version. – Rick James Sep 4 '17 at 17:32

It sounds like 5.7.19 jumped the gun.

----- 2016-02-05 5.7.11 General Availability -- Functionality Added or Changed -- -----

The mysql_kill() ( /doc/refman/5.7/en/mysql-kill.html ), mysql_list_fields() ( /doc/refman/5.7/en/mysql-list-fields.html ), mysql_list_processes() ( /doc/refman/5.7/en/mysql-list-processes.html ), and mysql_refresh() ( /doc/refman/5.7/en/mysql-refresh.html ) C API functions are deprecated and will be removed in a future version of MySQL. The same is true of the corresponding COM_PROCESS_KILL, COM_FIELD_LIST, COM_PROCESS_INFO, and COM_REFRESH client/server protocol commands. Instead, use mysql_query() ( /doc/refman/5.7/en/mysql-query.html ) to execute a KILL ( /doc/refman/5.7/en/kill.html ), SHOW COLUMNS ( /doc/refman/5.7/en/show-columns.html ), SHOW PROCESSLIST ( /doc/refman/5.7/en/show-processlist.html ), or FLUSH ( /doc/refman/5.7/en/flush.html ) statement, respectively.

Recommend you post a bug with bugs.mysql.com .

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.