How do I detect if a table exist? MySql

前端 未结 2 1532
终归单人心
终归单人心 2020-12-21 14:55

I was suggested to do this

SELECT table_schema, table_name FROM information_schema.tables
WHERE table_schema = \'mydb\' AND table_name=\'ApprovePost\';
         


        
2条回答
  •  伪装坚强ぢ
    2020-12-21 15:52

    Looks like you need to use the FLUSH TABLES command for the INFORMATION_SCHEMA.TABLES to reflect existing tables.

    Reference:

    • TABLE CACHE

提交回复
热议问题