MySQL Forums
Forum List  »  Newbie

Dump and reload gives different numbers of records
Posted by: Henry Law
Date: June 26, 2021 10:48AM

I have a simple database which contains details of files which are archived on a server. It uses MyISAM.

When copying the database to a different server I do this on the "source" server:

mysqldump -u nfb --databases nfb --no-tablespaces -r ~/NFBdb.sql -p

Then I transfer NFBdb.sql to the "target" server. It (my test machine) is running MySQL 5.7, but the production machine is running 8.0 so I have to use "sed" to edit some UTF8 stuff, with these two operations:

s/utf8mb4_0900_ai_ci/utf8_general_ci/g
s/utf8mb4/utf8/g

I then load up the test database with

mysql -u nfb -p < NFBdb.sql

Now the question. If I count the records in the "file" table in the source system this happens:

mysql -u nfb -p nfb -e 'SELECT COUNT(*) FROM file;'
+----------+
| COUNT(*) |
+----------+
| 72899 |
+----------+

But on the target system, database created directly from a dump of the source system, I have

mysql -u nfb -p nfb -e 'SELECT COUNT(*) FROM file;'
+----------+
| COUNT(*) |
+----------+
| 72819 |
+----------+

The sum of the sizes in the two databases (the total size of archived files) are off too, by about 700MB, and there's a significant mismatch in the record counts for at least one of the other tables.

Where should I start looking for whatever stupid mistake I've made?

Options: ReplyQuote


Subject
Written By
Posted
Dump and reload gives different numbers of records
June 26, 2021 10:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.