Home >Database >Mysql Tutorial >How to Grant SUPER Privileges in MySQL to Execute Specific Queries?

How to Grant SUPER Privileges in MySQL to Execute Specific Queries?

DDD
DDDOriginal
2024-12-24 20:51:14273browse

How to Grant SUPER Privileges in MySQL to Execute Specific Queries?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn