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

Support mysqlsh -- load-dump/copy-instance #96

Merged
merged 4 commits into from
Oct 16, 2024

Conversation

fanyang01
Copy link
Collaborator

@fanyang01 fanyang01 commented Oct 15, 2024

Resolves #94

Copy a MySQL instance

# Create an admin user in MyDuckServer
mysql -h127.0.0.1 -uroot -P3306 <<EOF
CREATE USER 'admin'@'%' IDENTIFIED BY 'admin';
GRANT ALL PRIVILEGES ON *.* TO 'admin'@'%';
SET GLOBAL local_infile = 1;
EOF

# Copy an existing MySQL instance to MyDuckServer
mysqlsh -h127.0.0.1 -P13310 -uroot -proot -- util copy-instance \
    'mysql://admin:[email protected]:3306' \
    --exclude-users root \
    --ignore-existing-objects true \
    --handle-grant-errors ignore

Load a MySQL dump

# Dump a MySQL instance
mysqlsh -h127.0.0.1 -P13310 -uroot -proot -- util dump-instance ./my-sh-dump
# Load the dump into MyDuckServer
mysqlsh -h127.0.0.1 -P3306 -uroot --no-password -- util load-dump ./my-sh-dump

@fanyang01 fanyang01 marked this pull request as ready for review October 16, 2024 09:52
Copy link
Contributor

@TianyuZhang1214 TianyuZhang1214 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fanyang01 fanyang01 merged commit 6524807 into main Oct 16, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

MySQL Shell compatibility
2 participants