PHPmyAdmin Default Databases

后端 未结 3 1973
日久生厌
日久生厌 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: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
    

提交回复
热议问题