PHPmyAdmin Default Databases

后端 未结 3 1961
日久生厌
日久生厌 2020-12-29 09:16

Ok this is more of a \'Keeping my house in order\' question.

PHPmyAdmin is installed but it has a bunch of databases installed as default.

•cdcol (1) •infor

相关标签:
3条回答
  • 2020-12-29 09:23

    Not all of those listed databases are phpMyAdmin related. Some are required for MySQL to operate normally.

    • performance_schema http://dev.mysql.com/doc/refman/5.5/en/performance-schema.html
    • information_schema http://dev.mysql.com/doc/refman/5.5/en/information-schema.html
    • test http://dev.mysql.com/doc/refman/5.0/en/database-use.html
    • mysql http://dev.mysql.com/doc/refman/5.5/en//adding-users.html

    cdcol Probably is for the cd collection sample database that comes with XAMPP. webauth is probably part of XAMPP as well.

    The only phpMyAdmin related database (as you probably already guessed) is phpmyadmin, you can delete it, but letting it be there would improve performance, and add more functionality to the phpMyAdmin.

    0 讨论(0)
  • 2020-12-29 09:25

    Delete the cdcol database; it is just a sample. For the other tables you mentioned, hide them from view by adding the following to config.inc.php.

    $cfg['Servers'][$i]['hide_db']='^(information_schema|performance_schema|mysql|phpmyadmin|test|webauth)$';
    
    0 讨论(0)
  • 2020-12-29 09:41

    If you are trying to do this via an automated script or command line:

    1. Create a hidedb.sql file and add the following content:

      USE 'phpmyadmin';
      UPDATE `pma__userconfig` SET `config_data` = '{\"Server\\/hide_db\":\"(information_schema|performance_schema|mysql|phpmyadmin)\",\"collation_connection\":\"utf8mb4_unicode_ci\"}' WHERE `pma__userconfig`.`username` = 'phpmyadmin';
      
    2. The Command line (or in a script - SAFER WAY):

      $ sudo mysql -u root -p < hidedb.sql

    Of course you'll have to enter your sudo and then your mysql root database password.

    If you're doing this in an automated script that you only can run as root:

    NOTE: THIS IS NOT A GOOD IDEA! It exposes your root password!

    DB_PWD="my_password"
    mysql -u root -p"$DB_PWD" < hidedb.sql
    
    0 讨论(0)
提交回复
热议问题