Hi Im trying to copy all my tables from one database to another just using mySQL. I have a code that I’ve been trying to use which dumps the tables into a sql file which i will then import into another database.
With all due respect, copying an entire database into another database is more complex than running INSERT queries.
Can it be done with a series of queries? Yes, I suppose so.
But mysqldump can do it all with a relatively short command.
Working from the CLI may be uncomfortable for some. And knowing what options to specify can take a bit of time to figure out.
Going (cd-ing) to the folder where mysqldump is - eg. mine is at c:\Program Files\MySQL\MySQL Server 5.7\bin
and entering “mysqldump --help” will be, errrm, a help.
And as r937 posted, error messages will help to pinpoint problems.