MySQL选择总是返回空集 [英] Mysql select always returns empty set

查看:193
本文介绍了MySQL选择总是返回空集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以由于某种原因,我的Mysql表总是返回一个空集

So for some reason my Mysql table always returns an empty set

mysql> show table status like 'test_table';
+-----------------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+------------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+
| Name            | Engine | Version | Row_format | Rows    | Avg_row_length | Data_length | Max_data_length | Index_length | Data_free  | Auto_increment | Create_time         | Update_time | Check_time | Collation          | Checksum | Create_options | Comment |
+-----------------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+------------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+
| test_table      | InnoDB |      10 | Compact    | 1625218 |            749 |  1218363392 |               0 |            0 | 1234173952 |           NULL | 2015-07-25 12:03:40 | NULL        | NULL       | utf8mb4_unicode_ci |     NULL |                |         |
+-----------------+--------+---------+------------+---------+----------------+-------------+-----------------+--------------+------------+----------------+---------------------+-------------+------------+--------------------+----------+----------------+---------+
1 row in set (0.00 sec)

mysql> select * from test_table;
Empty set (0.00 sec)

mysql> 

关于如何调试它的任何建议?

Any advice on how I can debug this?

这是创建表

| test_table | CREATE TABLE `test_table` (
  `export_date` bigint(20) DEFAULT NULL,
  `id` int(11) NOT NULL DEFAULT '0',
  `title` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `recommended_age` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `artist_name` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `seller_name` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `company_url` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `support_url` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `view_url` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `artwork_url_large` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `artwork_url_small` varchar(1000) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `release_date` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci |

推荐答案

原来是导入问题.我使用Python脚本导入了数据,并且没有将autocommit设置为true(该脚本是为旧版本的MYSQL编写的)

Turns out it was an import problem. I imported my data with a Python script and didn't have autocommit set to true (the script was written for an older version of MYSQL)

这篇关于MySQL选择总是返回空集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆