polardbx-sql
polardbx-sql copied to clipboard
can not dump all database by mysqldump
polardb-x cluster was created via:
$ pxd tryout -cn_replica 2 -cn_version latest -dn_replica 2 -dn_version latest -cdc_replica 2 -cdc_version latest
dump data by mysqldump
$ mysqldump -t -n -h127.0.0.1 -P58709 -upolardbx_root -pxx --all-databases --triggers --routines --events | grep -c INSERT
0
$ mysqldump -t -n -h127.0.0.1 -P58709 -upolardbx_root -pxx -B d1 d2 d3 | grep -c INSERT
4
@yejr can you provide some exception stack ?
@yejr can you provide some exception stack ?
How can i get the exception stack?
When i ran mysqldump, there are no errers reported, and also no exception stack.
According to mysqldump.cc#dump_all_databases, while dumping all databases, mysqldump client will find a database named mysql (the built-in System Schema) before dumping other databases.
However, the mysql schema does not exist in PolarDB-X, which leads to the empty output of mysqldump client.
Solution:
-
Solution-1: Create an empty database named
mysqlin PolarDB-X
-
Solution-2: Instead of using the
--all-databasesoption, just specify the target databases in the command line.