Problem Definition
When using PhpMyAdmin with XAMPP, the following error was received due to lack of authorization in the system tables belonging to the pma
user:
#1142 - SELECT command denied to user 'pma'@'localhost' for table 'pma__table_uiprefs'
This error prevents personal data such as table settings, column preferences, and views from being saved on the PhpMyAdmin interface.
Cause of Error
-
The
pma
user was created during the installation of XAMPP, but the necessary permissions such as SELECT, INSERT were not granted to the tables in thephpmyadmin
database. -
Additionally,
mysql.user
, one of the MySQL system tables, may be corrupted.
Solution Steps
1. Start XAMPP Control Panel as Administrator
-
Right-click the XAMPP Control Panel icon.
-
Click the "Run as administrator" option.
This step ensures that MySQL services run with full permissions.
2. Reset PhpMyAdmin Session
-
Click the "Clear session data" icon in the upper left corner of the PhpMyAdmin interface.
-
Browser cookies/session data will be cleared.
3. Repair from Command Line
Run Command:
cd C:\xampp\mysql\bin
.\u005cmysqlcheck -u root -p --auto-repair --databases mysql
If it asks for a password, press ENTER. (XAMPP is generally passwordless.)
4. Re-enter PhpMyAdmin
When the PhpMyAdmin session is refreshed, the error will be seen to be resolved. The pma
user will be able to access the system tables in the phpmyadmin
database.
The reason for this error is that the pma
user was not granted permissions and possibly corrupted MySQL tables. The problem has been successfully resolved by running XAMPP as administrator, resetting session data, and repairing system tables with the mysqlcheck
command.
This article provides a step-by-step guide to resolving authorization issues that may be encountered when using PhpMyAdmin.