File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 293293*/
294294checkDbHealth ();
295295
296+
297+ /*
298+ * Check command line mysql login
299+ */
300+ if ( !empty ($ conf ["mysql " ]["admin_password " ]) ) {
301+ $ 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 ' );
302+ } else {
303+ $ 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 ' );
304+ }
305+ $ retval = 0 ;
306+ $ retout = array ();
307+ exec ($ cmd , $ retout , $ retval );
308+ if ($ retval != 0 ) {
309+ die ("Unable to call mysql command line with credentials from mysql_clientdb.conf \n" );
310+ }
311+
296312/*
297313 * dump the new Database and reconfigure the server.ini
298314 */
You can’t perform that action at this time.
0 commit comments