Backup of MySQL views

[expired user #5821]'s profile image [expired user #5821] posted 12 years ago in General Permalink
Hi @all !

I backed up my db containing tables (OK, clear), procedures and view. Backup was made to single files for every db object. When looking at the backedup SQL for my views i doubt it can be reimported.

# Dumping structure for view xxx
DROP VIEW IF EXISTS xxx;
# Removing temporary table and create final VIEW structure
DROP TABLE IF EXISTS xxx;

And after that the sql of the view is stored. No "CREATE VIEW"-Statement.

So wheres the error in my brain ;)

Thx
Robert

[expired user #5821]'s profile image [expired user #5821] posted 12 years ago Permalink
Sorry, forgot: latest available HeidiSQL (6.0.0.3977), MySQL 5.5.17 and 5.5.18.

Robert
[expired user #6175]'s profile image [expired user #6175] posted 12 years ago Permalink
csiqojerncjsa,

I have this error also. This error does not matter if your version of MySQL is 5.0, 5.1, or 5.5. The workaround is to look for the SELECT statement after DROP TABLE IF EXISTS xxx and type this right in front of it:
CREATE VIEW xxx AS

They broke this in the nightlys, hoping to fix another issue with creating views. I believe the problem stems from not having a CREATE VIEW tab, and the developer just pasting the select statement into the SQL export. Hope that helps. FYI, this is still broken in the latest nightly 6.0.0.4036.
ansgar's profile image ansgar posted 12 years ago Permalink
See and starr issue #2625

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