This is probably a longshot but.. is it possible to duplicate a whole database layout (tables, view, procedures, everything) with a query or multiple queries in a stored procedure?
Basically looking for the same functionality as if I would use mysqldump like this
# mysqldump -u root -ppassword --no-data --routines dbname > file
//create database copyofdbname
# mysql -u root -ppassword copyofdbname < file
Is it possible to do this in a mysql procedure without any external tools?
I guess I could do the tables by using 'show tables' and then a iterate over the results to get the 'create table' statatements for each table and forward them into the new database.
This is just speculation though, no idea how I would copy the stored procedures from the database this way.