CyberX

mobile

How to rename database after Maria DB dump success

There are some ugly solutions for database management like Maria DB thats won't recover your mysql dump correct. For example it will ignore path where you want to write dump and change database randomly.

Fortunately, we have a terminal command to rebase tables:


mysql -uroot -proot misatkeDB -sNe 'show tables' | while read table; 
do mysql -uroot -proot -sNe "RENAME TABLE misatakeDB.$table TO target.$table"; 
done

You have to change user and password and wait for some minutes to accomplish.

Reviews

You can write here as guest with moderation. Please confirm your person if you have an account or register.

Add a review as guest
Lets draw: