finding if a table exists

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Is there a statement I can pose to determine if a given table even exists
within a MySQL database? THanks, Ike

Re: finding if a table exists

An error occurs if you try to create the table while it already
exists.. You can use this..

Or try: SELECT * from table_name : this will also fail..

Re: finding if a table exists

show tables from [database] (or only 'show tables' if it's in the active

You can append a like clause, to ask for a specific table:

show tables [from [database]] like 'abc_d%' (you can use _ and % as


Site Timeline