Assigning SUPER Privileges to a MySQL Database
When attempting to execute certain queries in MySQL, you may encounter an error message indicating that you lack the necessary SUPER privilege. This error typically arises when you try to set global configuration variables, such as log_bin_trust_function_creators.
To resolve this issue, you need to assign SUPER privileges to the user attempting to execute the query. This can be achieved through either the phpMyAdmin interface or the MySQL command-line console.
Using phpMyAdmin
Navigate to phpMyAdmin and select the "Privileges" option. Then, edit the desired user and click on the "Administrator" tab. Enable the "SUPER" checkbox and click "Go" to save the changes.
Using the Command Line
Alternatively, you can assign SUPER privileges using the command line. Execute the following code:
mysql> GRANT SUPER ON *.* TO user@'localhost' IDENTIFIED BY 'password';
Replace user with the username and password with the corresponding password.
To complete the process, run the following command:
mysql> FLUSH PRIVILEGES;
Note: It's important to assign SUPER privileges with *.* (all databases), as SUPER is a global privilege that applies to all databases.
The above is the detailed content of How to Grant SUPER Privileges in MySQL to Execute Specific Queries?. For more information, please follow other related articles on the PHP Chinese website!