Octavian Rasnita wrote:
Hi,
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.
Octavian
Hey,
Try:
mysql -u<user> -p<password> -e "SHOW TABLES FROM <database>;" > file.txt
Stijn
--
metastable
Stijn Verholen
Camille Huysmanslaan 114, bus 2
B-2020 ANTWERPEN
+32 (0)3 707 08 08
+32 (0)473 47 62 88
[EMAIL PROTECTED]
http://www.metastable.be
BTW-BE 0873.645.643
bankrek.nr. ING 363-0106543-77
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]