I want to copy my production database to my development environment. I copied website_production into mysql of my developemnt environment, so using SHOW DATABASES; now I have
website_development website_production
as databases. How can I copy and overwrite all tables with their content from website_production into website_developemnt using mysql commands?
What you can do is log in to MySQL and drop the tables that you plan to overwrite, then use --force on import.
It's not MySQL commands but it's the easiest method, from command line:
$ mysqldump -u user --password=pass live_db_name | mysql -u user --password=pass -h localhost duplicate_db_name
Works on Windows terminal too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With