Skip to content
Snippets Groups Projects
Commit 8f35cdb0 authored by Marius Burkard's avatar Marius Burkard
Browse files

- prevent running update when mysql cannot be used from command line with...

- prevent running update when mysql cannot be used from command line with credentials from mysql_clientdb.conf
parent 548c70cc
No related branches found
No related tags found
1 merge request!936add CentOS 8 detection
...@@ -293,6 +293,22 @@ if($conf['mysql']['master_slave_setup'] == 'y') { ...@@ -293,6 +293,22 @@ if($conf['mysql']['master_slave_setup'] == 'y') {
*/ */
checkDbHealth(); checkDbHealth();
/*
* Check command line mysql login
*/
if( !empty($conf["mysql"]["admin_password"]) ) {
$cmd = "mysql --default-character-set=".escapeshellarg($conf['mysql']['charset'])." --force -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." -p".escapeshellarg($conf['mysql']['admin_password'])." -P ".escapeshellarg($conf['mysql']['port'])." -D ".escapeshellarg($conf['mysql']['database'])." -e ". escapeshellarg('SHOW DATABASES');
} else {
$cmd = "mysql --default-character-set=".escapeshellarg($conf['mysql']['charset'])." --force -h ".escapeshellarg($conf['mysql']['host'])." -u ".escapeshellarg($conf['mysql']['admin_user'])." -P ".escapeshellarg($conf['mysql']['port'])." -D ".escapeshellarg($conf['mysql']['database'])." -e ". escapeshellarg('SHOW DATABASES');
}
$retval = 0;
$retout = array();
exec($cmd, $retout, $retval);
if($retval != 0) {
die("Unable to call mysql command line with credentials from mysql_clientdb.conf\n");
}
/* /*
* dump the new Database and reconfigure the server.ini * dump the new Database and reconfigure the server.ini
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment