开发者

Import triggers from a mysql dump file

I have encountered an unpleasant situation on a shared host. I was trying to impo开发者_StackOverflow中文版rt a database dump that contained several triggers. Upon executing

DELIMITER ;;

phpMyAdmin returned an error, stating that in order to change the delimiter, I need SUPER privileges.

However, when I manually typed the trigger create queries: (example)

DELIMITER ;;
CREATE TRIGGER after_insert_user AFTER INSERT ON user FOR EACH ROW
BEGIN
    INSERT INTO priv (uid,role) VALUES (NEW.id,'guest');
END;;

everything works absolutely fine.

Is there a way to get around this issue on a shared host (ie, I cannot gain root privileges for my database user), or will I be forced to manually copy the trigger creation queries each time I'm transferring the database from a local server to the production one?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜