http://www.mydediserver.co
Members
-
Joined
-
Last visited
Reputation Activity
-
http://www.mydediserver.co got a reaction from Tom in Query helpHello,
We can do this using a script. A sample script for duplicating all tables in a database with another name is attached herewith. Please try and run the script in a test environment before any updates in a live database.
Thanks,
MyDediServer Support
db_duplicate.php.gz
-
http://www.mydediserver.co got a reaction from Tom in Query helpHello,
MySql query is given below.
CREATE TABLE v2_tablename as select * from tablename;
where tablename is the name of table. You need to do this for every table in the database.
Please note that the above query will duplicate all records in the table. But if you do not want to duplicate records with table, please use the following query.
CREATE TABLE v2_tablename as select * from tablename limit 0;
Thanks,
MyDediServer Support
-
http://www.mydediserver.co got a reaction from Tom in Query helpHello,
We can do the same using phpMyAdmin also. The steps are given below.
Select database and then table from PhpMyAdmin
Select "Operations" menu
Select "Copy table to (database.table): "
From here you can duplicate table with options "Structure only" Or "Structure and data"
Thanks,
MyDediServer Support