On Tue, Mar 20, 2001 at 08:27:39AM +0100, René Tegel wrote:
> 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).
>
Third:
RENAME TABLE tbl_name TO new_table_name;
(see http://www.mysql.com/doc/R/E/RENAME_TABLE.html )
Fourth:
ALTER TABLE tbl_name RENAME [TO] new_table_name;
(see http://www.mysql.com/doc/A/L/ALTER_TABLE.html )
Depending on the version of MySQL you use, these may not be supported.
I use the fourth one on 3.23.33.
Regards,
Fred.
> ----- 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
>
--
Fred van Engen XO Communications B.V.
email: [EMAIL PROTECTED] Televisieweg 2
tel: +31 36 5462400 1322 AC Almere
fax: +31 36 5462424 The Netherlands
---------------------------------------------------------------------
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