Getting MySQL Schemas for All Tables Getting MySQL Schemas for All Tables sql sql

Getting MySQL Schemas for All Tables


I would use the --no-data option to mysqldump to dump the schema and not table data.

 mysqldump --no-data [db_name] -u[user] -p[password] > schemafile.sql


Login as root, then

show databases; # lists all databasesuse information_schema; # connect to the mysql schemashow tables;   select * from tables;

Everything you need is in the information_schema schema. If all you want to do is backup the db, use the builtin dump/restore capabilities.


How about using mysqldump?

mysqldump -u root -p[password] [db_name] > backupfile.sql