This is probably long, but .. is it possible to duplicate the entire database layout (tables, views, procedures and all) with a query or multiple queries in a stored procedure?
Basically looking for the same functionality as if I used mysqldump, like this
# mysqldump -u root -ppassword --no-data --routines dbname > file
Is it possible to do this in mysql procedure without any external tools?
I think I could make tables using "show tables" and then iterate over the results to get the "create table" statutes for each table and forward them to a new database. This is just an assumption, although I don’t know how I will copy stored procedures from the database in this way.
source share