I'm trying to drop a table from a schema I inherited. When I SHOW TABLES I get
+----------------------------+
| Tables_in_schema_a |
+----------------------------+
| table_1 |
| table_2 |
| table_3 |
| table_4 |
| table_5 |
| table_6 |
+----------------------------+
But when I execute DROP TABLE table_1 I get
ERROR 1051 (42S02): Unknown table 'table_1'
I'm using the correct schema. What's going on?
P.S. This is MySQL server is 5.1.73.
Turns out SHOW TABLES is actually a bit of a misnomer. That table, table_1, was unknown because it's actually a view. I ran SELECT table_name, table_type FROM information_schema.tables WHERE table_schema='schema_a' showed that it's a view. DROP VIEW table_1 deleted it.
Check whether the table is a VIEW, if so use the command
drop view table_name;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With