Skip to content

Commit 3dded7b

Browse files
author
Florian Schaal
committed
removed useless FLUSH PRIVILEGES
1 parent 7baf739 commit 3dded7b

File tree

5 files changed

+5
-27
lines changed

5 files changed

+5
-27
lines changed

install/dist/lib/gentoo.lib.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,6 @@ public function configure_powerdns()
472472
$this->error('Unable to create user for powerdns database Error: '.$this->db->errorMessage);
473473
}
474474

475-
//* Reload database privelages
476-
$this->db->query('FLUSH PRIVILEGES;');
477-
478475
//* load the powerdns databse dump
479476
if($conf['mysql']['admin_password'] == '') {
480477
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",

install/lib/installer_base.lib.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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",

install/update.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,9 +326,9 @@
326326
$inst->configure_postfix('dont-create-certs');
327327

328328
if($conf['dovecot']['installed'] == true) {
329-
//* Configure dovecot
330-
swriteln('Configuring Dovecot');
331-
$inst->configure_dovecot();
329+
//* Configure dovecot
330+
swriteln('Configuring Dovecot');
331+
$inst->configure_dovecot();
332332
} elseif ($conf['courier']['installed'] == true) {
333333
//** Configure saslauthd
334334
swriteln('Configuring SASL');

server/plugins-available/mysql_clientdb_plugin.inc.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ function db_insert($event_name, $data) {
228228

229229
}
230230

231-
$link->query('FLUSH PRIVILEGES;');
232231
$link->close();
233232
}
234233
}
@@ -433,7 +432,6 @@ function db_update($event_name, $data) {
433432
}
434433
}
435434
// Database is not active, so stop processing here
436-
$link->query('FLUSH PRIVILEGES;');
437435
$link->close();
438436
return;
439437
}
@@ -570,8 +568,6 @@ function db_update($event_name, $data) {
570568
}
571569
}
572570

573-
574-
$link->query('FLUSH PRIVILEGES;');
575571
$link->close();
576572
}
577573

@@ -621,7 +617,6 @@ function db_delete($event_name, $data) {
621617
$app->log('Error while dropping MySQL database: '.$data['old']['database_name'].' '.$link->error, LOGLEVEL_WARNING);
622618
}
623619

624-
$link->query('FLUSH PRIVILEGES;');
625620
$link->close();
626621
}
627622

@@ -685,7 +680,6 @@ function db_user_update($event_name, $data) {
685680
}
686681
}
687682

688-
$link->query('FLUSH PRIVILEGES;');
689683
$link->close();
690684

691685
}
@@ -721,7 +715,6 @@ function db_user_delete($event_name, $data) {
721715
}
722716
}
723717

724-
$link->query('FLUSH PRIVILEGES;');
725718
$link->close();
726719
}
727720

server/plugins-available/software_update_plugin.inc.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ private function create_app_db($db_config) {
267267
$app->log('Unable to create database user'.$db_config['database_user'].' '.mysqli_error($link), LOGLEVEL_ERROR);
268268
}
269269

270-
mysqli_query($link, "FLUSH PRIVILEGES;");
271270
mysqli_close($link);
272271

273272
}

0 commit comments

Comments
 (0)