Octavian Rasnita wrote:
> I want to print the list of tables (one on a line) from a database
> into an external file.
> 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.
> Thank you.
mysql -u<user> -p<password> -e "SHOW TABLES FROM <database>;" >
Camille Huysmanslaan 114, bus 2
+32 (0)3 707 08 08
+32 (0)473 47 62 88
bankrek.nr. ING 363-0106543-77