Mysql "select * from" does not return all rows

I am using PostgreSQL and do not understand this behavior in MySQL.

This table (from SugarCRM) has 3057 rows:

mysql> SELECT count(*) FROM tasks ; +----------+ | count(*) | +----------+ | 3057 | +----------+ 

But when running SELECT * FROM tasks :

 mysql> SELECT * FROM tasks ; ... 2344 rows in set (0,02 sec) 

I am using a rather old version of MySQL, but the problem is that I'm just trying to dump the database and restore the new version.

 # mysql --version mysql Ver 14.14 Distrib 5.1.51, for slackware-linux-gnu (x86_64) using EditLine wrapper 

Do you have any ideas?

+6
source share
1 answer

In general, the MyISAM table format is very reliable, but the tables can be damaged for various reasons, such as hardware failures, the mysqld process is destroyed during the write operation, untimely shutdown, or errors in the MySQL or MyISAM code. If you are using a very old version, there may be errors.

It is recommended that you make a backup before repair. To restore

 REPAIR [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [, tbl_name] ... [QUICK] [EXTENDED] [USE_FRM] 
+1
source

Source: https://habr.com/ru/post/972089/


All Articles