forums › forums › SQLyog › Using SQLyog › Import From Sql Statement Fails
- This topic is empty.
-
AuthorPosts
-
-
April 30, 2006 at 4:55 pm #9656CharlieMember
Hi,
I've generated SQL statements by using SQLyog Enterprise v5.02 with the wizard:
Scheduled Backups
after that I wanted to:
Import from sql statement
but I've got that error:
Query:
DROP TRIGGER `InsertHAENowDate`
Error occured at:2006-04-30 18:52:28
Line no.:8582
Error Code: 1360 – Trigger does not exist
and that's right because, when I'm doing an
Import from sql statement
the Trigger doesn't exist.
What can I do, that this script will work?
Or do I have to make cahnges, when I'm doing the:
Scheduled Backups
?
br
Charlie
-
April 30, 2006 at 5:50 pm #21482peterlaursenParticipant
1)
Well you can open the SQL in a text editor and delete the statement
*DROP TRIGGER `InsertHAENowDate`*
Please search if this trigger is reffered to somewhere else in the script too!
But hold it for 15 minutes. More info coming!
-
April 30, 2006 at 6:25 pm #21483peterlaursenParticipant
1)
The problem is that there is no 'drop TRIGGER if exists' available with MySQL trigger syntax!
Please try 5.12 beta3 !
http://www.webyog.com/betas/SQLyog512Ent.exe
(be aware that it migrates your 'Personal' folder to a 'favorites' folder if you 'install over'. If you do not want that then just install to another folder).
The 'export' tool here has implemented an option to select/deselect 'drop trigger' statment. This seems to be forgotten in the 'backup' powertool. See attached pics. 'drop trigger' is written to the file if 'create trigger is' selected.
To use the 'include drop trigger' with the export tool:
If you restore to an empty database you must deselect it.
To restore into a database where that trigger exists you must select it.
And if situation changed in between you'll have to edit the file! As 'if exists' is not available we have to chance to 'automate' it.
This should answer what you can do!
2)
To understand why this happened we will need more information about the server!
What server version? Is current version installed over a previous version?
If yes did you run all update scripts as specifed in the MySQL documentation.
Now is the database from where you made the backup still available? If yes then what does:
SELECT * from information_schema.TRIGGERS;
or
SELECT * from information_schema.TRIGGERS where TRIGGER_NAME = 'InsertHAENowDate';
return?
The backup tool does not 'invent' triggers. There must (have) been some trace of it in the system!
3)
I also just reported a bug with backup of triggers here myself:
http://www.webyog.com/forums/index.php?sho…view=getnewpost
4)
You are sure that this trigger was not there when you made the backup ?!
that would be the simple explanation!
any way to ensure that the execution of the script does not stop here (with error 1360), but goes on with next statement?
-
April 30, 2006 at 7:02 pm #21484
-
-
AuthorPosts
- You must be logged in to reply to this topic.