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

How to Grant SUPER Privileges in MySQL?

Patricia Arquette
Release: 2024-12-02 09:53:09
Original
330 people have browsed it

How to Grant SUPER Privileges in MySQL?

MySQL: Granting SUPER Privileges to a Database

When attempting to execute the query SET GLOBAL log_bin_trust_function_creators =1, you may encounter an #1227 - Access denied; you need the SUPER privilege for this operation error. This indicates that the user attempting to execute the query lacks the necessary SUPER privileges.

To grant SUPER privileges to a database, you have two options:

Using phpMyAdmin:

  • Open phpMyAdmin and navigate to the "Privileges" section.
  • Select the user you wish to grant privileges to and click "Edit User."
  • Under the "Administrator" tab, check the "SUPER" checkbox and click "Go."

Using the MySQL Console:

  1. Connect to the MySQL console as the root user.
  2. Execute the following command:

    mysql> GRANT SUPER ON *.* TO user@'localhost' IDENTIFIED BY 'password';
    Copy after login

    Replace user with the name of the user to be granted privileges and password with the user's password.

  3. Flush the privileges:

    mysql> FLUSH PRIVILEGES;
    Copy after login

Note:

The SUPER privilege is a global privilege that applies to all databases. Therefore, it is recommended to grant it using *.* (all databases) rather than a specific database name.

The above is the detailed content of How to Grant SUPER Privileges in MySQL?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template