Your Cart

Get Amazing Offers on Scripts

Get UX Support

How to troubleshoot #1227 Error in phpMyAdmin: Access Denied for Changing sql_mode Variable without SUPER or SYSTEM_VARIABLES_ADMIN Privileges? – Cloudpanel

To troubleshoot the #1227 error in phpMyAdmin, indicating access denied for changing the sql_mode variable without SUPER or SYSTEM_VARIABLES_ADMIN privileges, you can follow these steps:

  1. Check Current Privileges: Ensure that your MySQL user account has the necessary privileges to modify the sql_mode variable. You need either SUPER or SYSTEM_VARIABLES_ADMIN privileges for this operation.

  2. Review User Privileges: In phpMyAdmin, navigate to the “User Accounts” or “Privileges” section and check the privileges assigned to your MySQL user. If necessary, contact your database administrator to grant the required privileges.

  3. Grant SUPER or SYSTEM_VARIABLES_ADMIN Privilege: If your user lacks the necessary privileges, you’ll need to grant either SUPER or SYSTEM_VARIABLES_ADMIN privilege. Use MySQL’s GRANT statement to provide the required access.

grant all privileges on databasename.* to sqluser@'%' with grant option;

or

GRANT SUPER ON on databasename.* to sqluser@'%' with grant option;


GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO sqlsuser;
  1. Replace ‘your_user’ and ‘your_host’ with your actual MySQL username and host.

  2. Restart MySQL Server: After making changes to user privileges, restart the MySQL server to apply the modifications.

  3. Verify sql_mode Configuration: Check the current sql_mode configuration. If it includes specific modes that you are trying to enable or disable, ensure that you have the privilege to modify them.

  4. Use Configuration Files: Instead of modifying sql_mode directly through phpMyAdmin, consider updating the MySQL configuration files (e.g., my.cnf or my.ini). This can be done by adding or modifying the sql_mode entry. After making changes, restart the MySQL server.

  5. Contact Database Administrator: If the issue persists, contact your database administrator or hosting provider for further assistance. They can help review and adjust the necessary privileges or troubleshoot other potential issues.

Remember to exercise caution when modifying user privileges, and always have a backup of your database before making significant changes.

Cloudpanel Tutorial

Login  using SSH 

/etc/mysql/debian.cnf

Open debian.cnf File and copy the username and password from debian.cnf file

host     = localhost
user     = debian-sys-maint
password = anyTYpeOFPassword

Now Open SSH, add the below command and enter your password on prompt

mysql -u debian-sys-maint -p 

After applying the correct password below prompt will display

Now apply the below script

grant all privileges on databasename.* to sqluser@'%' with grant option;

GRANT SUPER ON on databasename.* to sqluser@'%' with grant option;

GRANT SYSTEM_VARIABLES_ADMIN ON *.* TO sqlsuser;

Now to confirm your changes paste the below code.

SHOW GRANTS FOR 'sqluser';

Now you can easily update phpmyadmin Server variables and settings

Note: If your SQL server reseting your changes use below code

set PERSIST sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

Still facing Issues ?

Contact me for paid support​ Mail me @ tutorialslides.com@gmail.com
Paid Support
Leave a Reply
Free Worldwide shipping

On all orders above $50

Easy 30 days returns

30 days money back guarantee

International Warranty

Offered in the country of usage

100% Secure Checkout

PayPal / MasterCard / Visa