Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not dump all database by mysqldump #105

Open
yejr opened this issue Nov 30, 2022 · 3 comments
Open

can not dump all database by mysqldump #105

yejr opened this issue Nov 30, 2022 · 3 comments

Comments

@yejr
Copy link

yejr commented Nov 30, 2022

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
@hustfxj
Copy link
Collaborator

hustfxj commented Dec 1, 2022

@yejr can you provide some exception stack ?

@yejr
Copy link
Author

yejr commented Dec 1, 2022

@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.

@F-ca7
Copy link
Collaborator

F-ca7 commented Dec 1, 2022

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.
image
However, the mysql schema does not exist in PolarDB-X, which leads to the empty output of mysqldump client.

Solution:

  1. Solution-1: Create an empty database named mysql in PolarDB-X
    image

  2. Solution-2: Instead of using the --all-databases option, just specify the target databases in the command line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants