[kwlug-disc] how to duplicate a mysql database?

Khalid Baheyeldin kb at 2bits.com
Tue Aug 25 16:50:58 EDT 2009


It is actually difficult to do what you have seen. The hardest part is
assigning permissions for a user. You can skip that if you are testing with
root.

# mysqladmin create newdb
# mysql
mysql> GRANT ALL ON newdb.* to someuser at localhost IDENTIFIED BY 'somepass';
^D
# mysqldump olddb | mysql newdb

That is it.

On Tue, Aug 25, 2009 at 4:31 PM, Robert P. J. Day <rpjday at crashcourse.ca>wrote:

>
>  i just want to make another "test" copy of a mysql database on the
> same system, to mess with while leaving the original alone.  the
> solution i've seen is to use mysqldump to dump it, then restore it
> under another name.  that, of course, works but is there an internal
> mysql command that will do that?  i didn't notice one.
>
> rday
> --
>
> =======================================================================
> Robert P. J. Day                               Waterloo, Ontario, CANADA
>
>        Linux Consulting, Training and Annoying Kernel Pedantry.
>
> Web page:                                          http://crashcourse.ca
> Twitter:                                       http://twitter.com/rpjday
> ========================================================================
>
> _______________________________________________
> kwlug-disc_kwlug.org mailing list
> kwlug-disc_kwlug.org at kwlug.org
> http://astoria.ccjclearline.com/mailman/listinfo/kwlug-disc_kwlug.org
>



-- 
Khalid M. Baheyeldin
2bits.com, Inc.
http://2bits.com
Drupal optimization, development, customization and consulting.
Simplicity is prerequisite for reliability. --  Edsger W.Dijkstra
Simplicity is the ultimate sophistication. --   Leonardo da Vinci
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20090825/aff3a3a9/attachment.htm>


More information about the kwlug-disc mailing list