copying tables between databases:

create table db2.table2 select * from db1.table1;

however, you'll loose meta data (indexes) on this table, so you'd have to
create them again.

second method:
use the explorer or a dos shell to rename any table or db as shown in the
\mysql\bin directory. From within the sql client the name of a db cannot be
changed afaik, but table names can. Read he docs on this issue ('alter
table' syntax).

regards,

rene



----- Original Message -----
From: "Marko Milutinovič" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 20, 2001 8:05 AM
Subject: Renaming and/or copying a database


> Hi!
>
> I'm running MySQL on Win NT 4. I'm trying to rename a database from my
> program, but I haven't found any inforamtion about this on the MySQL site.
> Can anybody help me?
>
> Can a database named 2001 be created? Can a database be copied to another
> one via SQL statements?
>
>
> regards,
> m@rko
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to