Page 1 of 1

can i rename database using mydac ? without loosing the data in database ?

Posted: Fri 23 Sep 2016 11:36
by drama22
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 ?

Posted: Fri 23 Sep 2016 12:46
by ViktorV
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 ?

Posted: Fri 23 Sep 2016 12:53
by drama22
can i copy a database tables to another ?

Re: can i rename database using mydac ? without loosing the data in database ?

Posted: Fri 23 Sep 2016 13:21
by ViktorV
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

Re: can i rename database using mydac ? without loosing the data in database ?

Posted: Mon 05 Dec 2016 23:51
by eduardosic
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`;