can i rename database using mydac ? without loosing the data in database ?
can i rename database using mydac ? without loosing the data in database ?
i want to rename database name using mydac can i do that ? also i dont want to lose the database tables data any idea how can i achieve this ?
Re: can i rename database using mydac ? without loosing the data in database ?
Since MySQL doesn't allow to rename database, MyDAC doesn't support such functionality.
Re: can i rename database using mydac ? without loosing the data in database ?
can i copy a database tables to another ?
Re: can i rename database using mydac ? without loosing the data in database ?
To solve your issue, you can use the TMyDump component. You can use it to backup objects of one database and then restore them to another database. See more details about this component in MyDAC help: https://www.devart.com/mydac/docs/devar ... mydump.htm
-
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
Re: can i rename database using mydac ? without loosing the data in database ?
you can try this:
CREATE DATABASE `NEW_DB_NAME` /*!40100 COLLATE 'latin1_swedish_ci' */;
RENAME TABLE `OLD_DB_NAME`.`table1` TO `NEW_DB_NAME`.`table1`,
`OLD_DB_NAME`.`table2` TO `NEW_DB_NAME`.`table2`,
`OLD_DB_NAME`.`table3` TO `NEW_DB_NAME`.`table3`;
CREATE DATABASE `NEW_DB_NAME` /*!40100 COLLATE 'latin1_swedish_ci' */;
RENAME TABLE `OLD_DB_NAME`.`table1` TO `NEW_DB_NAME`.`table1`,
`OLD_DB_NAME`.`table2` TO `NEW_DB_NAME`.`table2`,
`OLD_DB_NAME`.`table3` TO `NEW_DB_NAME`.`table3`;