Is there any tool to export a MySQL db structure to an Excel file? For example:
1 ID int(10) not null pri 0 index comment
Thanks for any help.
You could query information_schema.columns
to obtain the required data:
SELECT * from information_schema.columns
WHERE table_schema = 'db_2_66028'
AND table_name = 'tbl';
table_schema
is the name of your dbtable_name
the name of the table. If you omit this, you will query column information for all your tables.See http://sqlfiddle.com/#!2/23f9b/1 for live demo. Here I used SELECT *
for simplicity, but you will probably have to select only the require columns for your specific need.
In addition, MySQL is able to export query result as CSV file, a text format that Excel, like any other spreadsheet, might easily read. Something like that might do the trick:
SELECT * from information_schema.columns
WHERE table_schema = 'db_2_66028'
AND table_name = 'tbl'
INTO OUTFILE '/tmp/result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY ‘\\’
LINES TERMINATED BY '\n'
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