mysqlphpmyadmin

exporting table structure to Excel files with phpmyadmin


I' going to create an excel file from my table structure in Phpmyadmin(structure only).I found that it has a CSV output but it gives me just data.
Does Phpmyadmin has any feature to do such a thing or not?

Edit: it's my sql :

SELECT * INTO OUTFILE 'c://wamp/my_table_structure.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES  TERMINATED BY '\n'
FROM   INFORMATION_SCHEMA.COLUMNS
WHERE  TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'dt_user'

why it return an empty file?


Solution

  • You could run a SELECT ... INTO OUTFILE query along the following lines:

    SELECT * INTO OUTFILE '/path/to/my_table_structure.csv'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    LINES  TERMINATED BY '\n'
    FROM   INFORMATION_SCHEMA.COLUMNS
    WHERE  TABLE_SCHEMA = DATABASE() AND TABLE_NAME = 'my_table'