@@ -263,19 +263,15 @@ public function add_database_server_record() {
263263 }
264264
265265 // Delete ISPConfig user in the local database, in case that it exists
266- $ this ->db ->query ("DELETE FROM mysql.user WHERE User = ? AND Host = ? " , $ conf ['mysql ' ]['ispconfig_user ' ], $ from_host );
267- $ this ->db ->query ("DELETE FROM mysql.db WHERE Db = ? AND Host = ? " , $ conf ['mysql ' ]['database ' ], $ from_host );
268- $ this ->db ->query ('FLUSH PRIVILEGES ' );
266+ $ this ->db ->query ("DROP USER ?@? " , $ conf ['mysql ' ]['ispconfig_user ' ], $ from_host );
267+ $ this ->db ->query ("DROP DATABASE IF EXISTS ? " , $ conf ['mysql ' ]['database ' ]);
269268
270269 //* Create the ISPConfig database user in the local database
271270 $ query = 'GRANT SELECT, INSERT, UPDATE, DELETE ON ?? TO ?@? IDENTIFIED BY ? ' ;
272271 if (!$ this ->db ->query ($ query , $ conf ['mysql ' ]['database ' ] . ".* " , $ conf ['mysql ' ]['ispconfig_user ' ], $ from_host , $ conf ['mysql ' ]['ispconfig_password ' ])) {
273272 $ this ->error ('Unable to create database user: ' .$ conf ['mysql ' ]['ispconfig_user ' ].' Error: ' .$ this ->db ->errorMessage );
274273 }
275274
276- //* Reload database privelages
277- $ this ->db ->query ('FLUSH PRIVILEGES; ' );
278-
279275 //* Set the database name in the DB library
280276 $ this ->db ->setDBName ($ conf ['mysql ' ]['database ' ]);
281277
@@ -655,10 +651,6 @@ public function grant_master_database_rights($verbose = false) {
655651 }
656652 }
657653
658- /*
659- * It is all done. Relod the rights...
660- */
661- $ this ->dbmaster ->query ('FLUSH PRIVILEGES ' );
662654 }
663655
664656 }
@@ -1472,9 +1464,6 @@ public function configure_powerdns() {
14721464 $ this ->error ('Unable to create user for powerdns database Error: ' .$ this ->db ->errorMessage );
14731465 }
14741466
1475- //* Reload database privelages
1476- $ this ->db ->query ('FLUSH PRIVILEGES ' );
1477-
14781467 //* load the powerdns databse dump
14791468 if ($ conf ['mysql ' ]['admin_password ' ] == '' ) {
14801469 caselog ("mysql --default-character-set= " .$ conf ['mysql ' ]['charset ' ]." -h ' " .$ conf ['mysql ' ]['host ' ]."' -u ' " .$ conf ['mysql ' ]['admin_user ' ]."' ' " .$ conf ['powerdns ' ]['database ' ]."' < ' " .ISPC_INSTALL_ROOT ."/install/sql/powerdns.sql' &> /dev/null " ,
0 commit comments