Two different databases displayed in phpMyAdmin interface

Created:

2016-11-16 13:16:42 UTC

Modified:

2017-08-08 13:38:20 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Two different databases displayed in phpMyAdmin interface

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 12.5 for Windows

Symptoms

Trying to open particular database DB_name in Plesk via Websites & Domains > Databases > phpMyAdmin

phpMyAdmin does not clearly show which database is accessed in phpMyAdmin side panel when there is the same database user with User has access to all databases within the selected subscription option checked.

Cause

Internal Plesk issue #PPPM-4734 related to phpMyAdmin issue #12585

Resolution

If there are sevaral phpMyAdmin databases

  1. Login to the database:

    # plesk db
  2. Find a database name used by phpMyAdmin to store config.

    mysql> show databases like 'phpmyadmin%';
    +-------------------------+
    | Database (phpmyadmin%) |
    +-------------------------+
    | phpmyadmin_NQomVQXRau1q |
    +-------------------------+
    1 row in set (0.00 sec)

    Note: If the query returned more than one database name, then fetch the actual database name from the config:

    ~# grep "^\\$cfg\\['Servers'\\]\\[\\$i]\\['controluser'\\]" /usr/local/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/config.default.php | cut -d: -f2
    'pma_NQomVQXRau1q';

    mysql> use phpmyadmin_NQomVQXRau1q;

    mysql> select * from phpmyadmin_NQomVQXRau1q.pma_userconfig where username='db_user';
    +----------+---------------------+-----------------------------------------------------------------------------------------------------------------+

    | username | timevalue | config_data |
    +----------+---------------------+-----------------------------------------------------------------------------------------------------------------+

    | db_user | 2016-09-22 02:03:50 | {"Server\\/hide_db":"","Server\\/only_db":["some_db_name"],"lang":"en","collation_connection":"utf8_unicode_ci"} |
    +----------+---------------------+-----------------------------------------------------------------------------------------------------------------+
    1 row in set (0.00 sec)

    Note: db_user should be substitued with the one from Websites & Domains > Databases tab for affected database

  3. Remove "Server\\/hide_db" and "Server\\/only_db" parameters from the config stored in the database

    mysql> begin;
    mysql> update phpmyadmin_NQomVQXRau1q.pma_userconfig set config_data='"lang":"en","collation_connection":"utf8_unicode_ci"}' where username='db_user';
    mysql> commit;
Have more questions? Submit a request
Please sign in to leave a comment.