Skip to content

Instantly share code, notes, and snippets.

@davidwaterston
Created September 18, 2012 06:21
Show Gist options
  • Save davidwaterston/3741543 to your computer and use it in GitHub Desktop.
Save davidwaterston/3741543 to your computer and use it in GitHub Desktop.
MySQL: Check if a table exists - version 1
select table_name as found
from information_schema.tables
where table_schema = '__database_name__'
and table_name = '__table_name__'
@davidwaterston
Copy link
Author

Where you are unsure what the 'database_name' is (i.e. the schema the query is running in) then use this version instead: https://gist.github.com/3742116

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment