Export database to sql, Drop view, and drop table for all views and tables

shanyiqua's profile image shanyiqua posted 3 years ago in Import/Export Permalink

Hi!

I've just exported a mysql database with drop-create script, to import to another mysql instance. I'm getting error on import: ERROR 1347 (HY000) at line 4034: 'mydb.mytable' is not VIEW which is true, because its't not a view, but a table. Looking at the script, i see, all tables and views have both drop table and drop view if exists.

I think it's quite retarded that mysql evaluates this as a blocking error, and not just a warning "hey you can't drop a view if it's a table, vice-versa", and continues with the next query, but that's how it works.

I don't see an option to change this behavior. How can i fix this, except of dropping database manually, and import just create script?

ansgar's profile image ansgar posted 3 years ago Permalink

Tables are reported as a view in some cases when the table is broken in some way. Please try to repair that table, using a REPAIR TABLE ... query, or the dialog in Tools > Maintenance.

shanyiqua's profile image shanyiqua posted 3 years ago Permalink

heidi generates both drop dable and drop view for all tables. For repair: "the storage engine for table does not support repair" (innoDB).

Does the same when exporting from new database created with the mysql client dump sql.

ansgar's profile image ansgar posted 3 years ago Permalink

Try out CHECK TABLE then. Even OPTOMIZE TABLE could help here.

shanyiqua's profile image shanyiqua posted 3 years ago Permalink

None of these help, same happens on export.

Please login to leave a reply, or register at first.