I want to print the list of tables (one on a line) from a database into an
I have tried:
mysql -u user -p database -e 'show tables;' > file.txt
mysql -u root -p information_schema -e 'select table_name from tables where
table_schema="database_name";' > file.txt
But the result was the help file displayed by MySQL when a command is not
correct. The SQL queries I gave are correct, because they work when I give
them at the mysql prompt.
The list of tables is big, and it doesn't fit into a screen and that's why I
need to print it into a file.
Please tell me how can I do this if it possible.