How to centralize phpMyAdmin

patrik

Verified User
Joined
Sep 6, 2006
Messages
128
First of all, install phpMyAdmin on a machine where it should run. This HowTo does not cover this procedure.
So now we have to make sure that this host is added to every new database that is created. This is done with the custom script database_create_post.sh. My scripts are written in perl so I have the shell script invoking my perl script.

Be sure to change $accesshost in both addhost.pl and database_create_post.pl. You might also want to change $mysqlbinpath in addhost.pl, and PERLPATH in database_create_post.sh

database_create_post.pl grants access for both the DA username and the particular DB user for the PMA host (specified by $accesshost).

addhost.pl is a tool to add the PMA host on every already existing user. It uses mysqldump to make a backup copy of the MySQL user and db table before pushing new data to it. It also shows some (not so?) fancy output.

Both perl scripts reads and uses the data in /usr/local/directadmin/conf/mysql.conf.

Note 1: I don't use the custom script database_user_create_post.sh at all at the moment. I might want to write a script for this too.

Note 2: Today I noticed that the DA team have added (what I requested for) custom scripts when a user deletes a database (thumbs up!). I really should write a script to also remove the user when the database is deleted, otherwise we will get unnecessary access hosts in MySQL. I have obviously not yet written these scripts.
 

Attachments

  • cent_pma.tar.gz
    2.2 KB · Views: 227
Last edited:
Note. addhost.pl updated 2006-11-28 13:35. Removed a GROUP BY clause which caused the script to skip rows.
For those of you (if any) who are using the scripts, just download the new tar.gz and run the updated addhost.pl and you'll see that it will do few a more insertions.
 
Back
Top