List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:October 17 1999 7:45pm
Subject:mysqlshow doesn't work for tables with underscores
View as plain text  
>>>>> "list" == list  <list@stripped> writes:

>> Description:
list> mysqlshow doesn't show tables that have underscores in them, ie, the
list> following works:

list> mysqlshow dcse_main computer

list> but this does not:

list> mysqlshow dcse_main index_entity_12

list> and neither does this:

list> mysqlshow testfeest index_entity_12

list> SHOW COLUMS FROM however works correctly when connected to the
list> right database.
>> How-To-Repeat:
list> Create database and tables as in the examples in de description.
>> Fix:
list> Use SHOW COLUMNS instead.


The problem is that '_' is a wildcard in SQL, and if you give a wildcard to
mysqlshow, it will use patter matching for what's shown.

From mysqlshow --help:

If last argument contains a shell wildcard (* or ?) then only what's
matched by the wildcard is shown.
If no database is given then all matching databases are shown.
If no table is given then all matching tables in database are shown
If no field is given then all matching fields and fieldtypes in table
are shown


In the case of:

mysqlshow testfeest index_entity_12

mysqlshow thinks you are asking for:

Show all table names in testfeest that matches 'index_entity_12'

Try this:

mysqlshow testfeest i%

If you want the column names, you can use:

mysqlshow testfeest index_entity_12 %

(I know this isn't intuitive, but we haven't come up with anything
better to give both functionalities)


mysqlshow doesn't work for tables with underscoreslist15 Oct
  • mysqlshow doesn't work for tables with underscoresMichael Widenius17 Oct
  • Re: mysqlshow doesn't work for tables with underscoresJim Faucette18 Oct