System Administrator's Guide/Granting Trigger Privilege

From Mahara Wiki
Jump to navigation Jump to search

If your Mahara database user does not have permission to create triggers on the database, you will need to explicitly grant the trigger privilege to the user. To do this, issue the following command in your MySQL client:

 GRANT TRIGGER ON <mahara_db_name>.* TO '<mahara_db_user>'@'localhost';

Replace <mahara_db_name> with the name of your Mahara database, and <mahara_db_user> with the database user. You can find these values in your config.php file, under $cfg->dbname and $cfg->dbuser.

If you don't have access to the terminal client, but created the database user using some external tool like 'mysql administrator', you should be able to edit the user's permissions using the same tool. Make sure the TRIGGER privilege is granted.

If you have granted trigger privileges to the appropriate user, but you are still having trouble upgrading or installing, the following post and bug report may be helpful:

Binary logging

Another problem with mysql and trigger privileges can be due to binary logging.

Check if you are doing binary logs. On a Ubuntu/Debian system:

Look in /etc/mysql/my.cnf (or maybe my.ini), or in /etc/mysql/mysql.conf.d/mysqld.cnf. Try adding

 log_bin_trust_function_creators = 1

If that doesn't work another way around this problem, if acceptable, is to disable binary logging.

To do it, remove the log_bin_trust_function_creators line and comment out log_bin and/or log_bin_index lines in the /etc/mysql/my.cnf (if they are there or in another cnf file)

After either change:

 sudo service mysql stop
 sudo service mysql start

See: