MySQL: Cloning a MySQL database on the same MySql instance
2.Feb.2021
Normally we have to copy one database to another on the same server we download the SQL file of one db and import into another.
This approach works fine for small databases. If you have huge database like more than 2 GB, then this process takes really long time and sometimes crashes the PHP Myadmin.
Here is a piped command through which we can copy one databse into other.
db1: is the databse from where we want to copy
db2: is the databse where we will copy.
mysqldump -u <user name> --password=<pwd> db1 | mysql -u <user name> -p db2
It will ask for the password and your db1 will be copied to other db2.
** Note: source and destination databses should arleady exist before running this command.
Leave a Reply
We'll try to resolve your queries asap.
Recent Posts
7.Nov.2024 | codedrill | Uncategorized
Fun and Interactive Number Game for Kids: Learning ‘Before, After, and Between’ Numbers from 1 to 40
Looking for a fun, interactive way to help young children learn basic number concepts? This simple web-based
22.Jan.2024 | codedrill | Drupal
Drupal 7 to 10 migration services
Hire Codedrill for Drupal 7 to Drupal 10 migration. We also offer complete drupal development services from