Subscribe to RSS feed  Follow @jackvamvas - Twitter

*Use the Comments section for questions Links



How to move a MariaDB table to another database;

15 April,2021 by Rambler

There are some different approaches to moving tables between MariaDB database

Method 1: Move a table to another database - 

This will actually move the table

alter table mig_test.testtbl rename mig_test1.testtb1;


Method 2: Entire Database 

Assumed the permissions on source and target database plus underlying file permissions for the dump files are sufficient

--step 1 - dump out the data onto a local file. Ensure you have permissions on the target folder. Note use of mysqldump 

mysqldump -u root databasename_source > dump.sql

--step 2 - import the data from the local file onto the target database. Note use of mysql command

mysql -u root databasename_target < dump.sql


Read more on MariaDB commands

Author: Rambler (


Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.


Post a comment on How to move a MariaDB table to another database;