5 * This script generates SQL used to update MySQL users on a hardcoded
6 * list of hosts. It takes care of setting the wikiuser for every
7 * database as well as setting up wikiadmin.
11 * @ingroup Maintenance
15 $wikiuser_pass = `wikiuser_pass`
;
16 $wikiadmin_pass = `wikiadmin_pass`
;
17 $nagios_pass = `nagios_sql_pass`
;
31 print "/*!40100 set old_passwords=1 */;\n";
32 print "/*!40100 set global old_passwords=1 */;\n";
34 foreach( $hosts as $host ) {
35 print "--\n-- $host\n--\n";
36 print "\n-- wikiuser\n\n";
37 print "GRANT REPLICATION CLIENT,PROCESS ON *.* TO 'wikiuser'@'$host' IDENTIFIED BY '$wikiuser_pass';\n";
38 print "GRANT ALL PRIVILEGES ON `boardvote%`.* TO 'wikiuser'@'$host' IDENTIFIED BY '$wikiuser_pass';\n";
39 foreach( $databases as $db ) {
40 print "GRANT SELECT, INSERT, UPDATE, DELETE ON `$db`.* TO 'wikiuser'@'$host' IDENTIFIED BY '$wikiuser_pass';\n";
43 print "\n-- wikiadmin\n\n";
44 print "GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'wikiadmin'@'$host' IDENTIFIED BY '$wikiadmin_pass';\n";
45 print "GRANT ALL PRIVILEGES ON `boardvote%`.* TO wikiadmin@'$host' IDENTIFIED BY '$wikiadmin_pass';\n";
46 foreach ( $databases as $db ) {
47 print "GRANT ALL PRIVILEGES ON `$db`.* TO wikiadmin@'$host' IDENTIFIED BY '$wikiadmin_pass';\n";
49 print "\n-- nagios\n\n";
50 print "GRANT REPLICATION CLIENT ON *.* TO 'nagios'@'$host' IDENTIFIED BY '$nagios_pass';\n";