Error: PHP Fatal error: Uncaught mysqli_sql_exception: Access denied; you need (at least one of) the SUPER privilege(s)

Post Reply
User avatar
isscbta
Team Member
Posts: 131
Joined: Mon Jul 19, 2021 1:41 am
Has thanked: 16 times
Been thanked: 3 times

This error is thrown by MySQL when a user tries to execute a command that requires SUPER privileges.

The SUPER privilege is powerful, and it controls many aspects of server operation. It allows a user to perform operations like setting global system variables, killing or inspecting sessions for other users, and performing actions that could potentially impact the entire server.

The error message "Access denied; you need (at least one of) the SUPER privilege(s) for this operation" indicates that the MySQL/MariaDB user used in your PHP application does not have the necessary permissions to perform a specific operation.

In order to fix this, in your SSH, as root, run:

Code: Select all

mysql
Then paste:

Code: Select all

GRANT ALL PRIVILEGES ON DBNAME.* to 'DBUSER'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON  DBNAME.* to 'DBUSER'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
Change DBNAME and DBUSER to your database name and MySQL/MariaDB user.

Tags:
Post Reply