Edventures in Normalcy

I want all DB’s moved, from SQL Server/Instance A to SQL Server/Instance B.  The easiest way to do this of course, is scripted :D.  Oh how I love the idea of automation.

Generate export script:

Use the output to backup the databases.

Then run the following command to get the import commands you would run on the destination instance:

Migrating MySQL Users Between Servers

Posted by Rose Bush on November 13th, 2012

I want a ONE liner to migrating MySQL users between servers. We know that migrating databases is easy enough using mysqldump, but migrating users from one MySQL instance or server to separate one can be annoying. Based on well known export commands, here is a neat little piped set of commands that you can run on the source DB server. The command will generate all the GRANT statements that you can simply run on the destination DB server.

If you are logged in as root user and do NOT need to supply user and password:

Hey, lets go two better, lets run the output, and add semicolons at the end of the lines to make the output appropriate to run on the destination server.

The beauty of this is that you need not know the passwords for any of the mysql user accounts and are then given one block of output, instead of the commands to run to get the grants.

*Migrating all databases except mysql and information_schema:

Originaly found on http://jasonbos.co/migrating-mysql-users-from-one-server-to-anot

MySQL to MySQL move of data!

Posted by Rose Bush on November 12th, 2012

Sometimes you want to move a database between hosts, this is an easy way to cut down on the clutter created in the process, is to output the backup directly to the new host.

Copyright © 2026 Edventures in Normalcy. All rights reserved.