I have a Problem to import the Sakila Database in Mysql5.0.51b.
The specific problem is in the ‘DELIMITER SYNTAX’, I have tried some alternatives but didn´t works.
I use APPServr.
MYSQL MESSAGE ERROR:
--
-- Triggers for loading film_text from film
--
DELIMITER;
MySQL said:
#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near
'DELIMITER' at line 1
DELIMITER CODE:
DELIMITER ;;
CREATE TRIGGER `ins_film` AFTER INSERT ON `film` FOR EACH ROW BEGIN
INSERT INTO film_text (film_id, title, description)
VALUES (new.film_id, new.title, new.description);
END;;
CREATE TRIGGER `upd_film` AFTER UPDATE ON `film` FOR EACH ROW BEGIN
IF (old.title != new.title) OR (old.description != new.description) OR (old.film_id != new.film_id)
THEN
UPDATE film_text
SET title=new.title,
description=new.description,
film_id=new.film_id
WHERE film_id=old.film_id;
END IF;
END;;
CREATE TRIGGER `del_film` AFTER DELETE ON `film` FOR EACH ROW BEGIN
DELETE FROM film_text WHERE film_id = old.film_id;
END;;
DELIMITER ;
I am not familiar with
APPServr, and would suspect it for twisting some commands before sending over to MySQL (this is not an accusation, merely a suspicion).I have successfully imported the
sakiladatabase numerous times in classroom. The best way, in my opinion, is to simplySOURCEit from themysqlcommand line client:Otherwise you can import via command line from shell/Command:
And also, using MySQL Workbench I’ve evidenced no problems with this.