Error 1347 indicates you are trying to perform an operation on the wrong kind of database object, such as calling DROP VIEW on a table.
MySQL Error 1347: ER_WRONG_OBJECT occurs when the object you reference is not the expected type for the command (for example, issuing ALTER TABLE on a view). Verify the object’s type with SHOW FULL TABLES, then rerun the correct statement on the proper object or recreate the object with the right type.
%s.%s' is not %s
Error 1347 (ER_WRONG_OBJECT) fires when MySQL detects a mismatch between the SQL statement and the referenced object type. The server expects the object to be a table, view, trigger, or routine that matches the command. If the type differs, execution stops and returns the message “db_name.obj_name is not object_type”.
The error protects metadata integrity. Dropping or altering the wrong kind of object could corrupt schemas or break dependencies, so MySQL blocks the operation immediately.
Developers encounter error 1347 while running DDL commands like ALTER TABLE, DROP VIEW, or TRUNCATE TABLE on an object that was created as another type. The problem also shows up in stored procedures that reference outdated object definitions after schema refactoring.
It is version agnostic and can occur in MySQL 5.7, 8.0, Amazon RDS, Google Cloud SQL, and MariaDB forks.
Leaving the error unresolved blocks deployment pipelines and automated migrations. Continuous integration jobs fail, and data teams lose productivity. Fixing it ensures DDL scripts run cleanly, backups restore, and applications relying on correct object types remain reliable.
Issuing DROP VIEW against a base table or DROP TABLE against a view immediately triggers error 1347.
A table dropped and later recreated as a view keeps the same name but different type, confusing legacy scripts.
Long-running applications store the original object type and call outdated DDL.
Developers sometimes mis-type object names, referencing a similarly named view rather than the intended table.
Schema change tools may attempt to alter a table before the view with the same name is dropped, causing a type mismatch.
Occurs when the object does not exist at all, unlike 1347 which exists but with the wrong type.
Similar to 1051 but arises during SELECT/INSERT operations rather than DDL.
Raised when the specified database does not exist. Verify db_name before checking object type.
Happens when attempting to EXPLAIN a view without underlying access, conceptually different yet also view related.
Run SHOW FULL TABLES or query INFORMATION_SCHEMA.TABLES where TABLE_TYPE indicates BASE TABLE or VIEW.
You must DROP the view first, then CREATE TABLE with the same name. Backup data before dropping to avoid loss.
TRUNCATE works only on BASE TABLE objects. If the name points to a view, MySQL returns ER_WRONG_OBJECT.
Galaxy highlights object types in the schema browser and warns when a DDL command mismatches the type, reducing the chance of ER_WRONG_OBJECT.