问题
I'm running mysqldump from an older mysql database. The mysqldump is part of a mariadb distribution if it matters.
When I run mysqldump locally, it's fine. When I run it on a remote system, I get no data dumped. If I run it with mysqldump -v the last line is
Skipping dump data for table 'table1', it has no fields
回答1:
From some googling and this reddit thread, I determined that you need to set the default locale.
So the command that worked for me was:
mysqldump --default-character-set=latin1 --lock-tables=false --single-transaction=TRUE --host=$HOST --user=$USER --password=$PASSWORD $DB
I used both lock-tables and single transaction because I have a mix of myisam and innodb tables.
来源:https://stackoverflow.com/questions/54139701/mysqldump-fails-with-skipping-dump-data-for-table-table1-it-has-no-fields