The solution to the problem of setting trigger permissions in MYSQL

        The example of this article describes the method of setting trigger permissions in MYSQL, which is very practical for the situation of wrong permissions. The specific analysis is as follows:

        The mysql import data prompt has no SUPER Privilege privilege processing, as follows:

ERROR 1419 (HY000): You do not have the SUPER Privilege and Binary Logging is Enabled

        Import function and trigger to MySQL database, and report an error:

You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)”.

reason:

        There are dangerous statements in function/trigger that modify the database, the error only occurs on servers with the binary logging option enabled for master-slave replication.

The workaround is as follows:

        1) Users who import data not only need CREATE ROUTINE, ALTER ROUTINE, CREATE TRIGGER, ALTER TRIGGER, CREATE FUNCTION and ALTER FUNCTION permissions, but also need SUPER privileges permissions to import data using super user.

        2) Give all users permission to perform similar functions, dangerous, not recommended.

o by specifying it on the server start, like: –log-bin-trust-function-creators=1
 o by setting it to 1 through the SET GLOBAL statement, like:
mysql> SET GLOBAL log_bin_trust_function_creators = 1;

        3) If you do not need to copy, or from the library, close binlog,

# binary logging – not required for slaves, but recommended
#log-bin=mysql-bin
# binary logging format – mixed recommended
#binlog_format=mixed

 

Article source: http://www.jb51.net/article/54635.htm

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326780213&siteId=291194637