List:General Discussion« Previous MessageNext Message »
From:Octavian Rasnita Date:May 1 2007 7:46am
Subject:show tables
View as plain text  
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

Thread
show tablesOctavian Rasnita1 May
  • Re: show tablesStijn Verholen1 May
    • Re: show tablesMogens Melander1 May
  • Re: show tablesOctavian Rasnita1 May