I want to print the structure of a table fomr my database.
Now I use the mysql command:

DESCRIBE products;

But how do I get this output into a txt file? Like:

DESCRIBE products; > products.txt
有帮助吗?

解决方案

mysql -u username -p -e 'DESCRIBE databasename.tablename' > output.txt
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top