Skip to content

Commit dad105f

Browse files
author
Marius Burkard
committed
Merge branch 'master' into 'stable-3.1'
more detaled informations during install/setup when mysql is not using NO_ENGINE_SUBSTITUTION See merge request !288
2 parents 50306f0 + c51b57e commit dad105f

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

install/lib/installer_base.lib.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,12 @@ public function configure_database() {
217217
//* check sql-mode
218218
$check_sql_mode = $this->db->queryOneRecord("SELECT @@sql_mode");
219219

220-
if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') die('Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION');
220+
if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') {
221+
echo "Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add\n\n";
222+
echo " sql-mode=\"NO_ENGINE_SUBSTITUTION\"\n\n";
223+
echo"to the mysqld-section in /etc/mysql/my.cnf and restart mysqld afterwards\n";
224+
die();
225+
}
221226

222227
//** Create the database
223228
if(!$this->db->query('CREATE DATABASE IF NOT EXISTS ?? DEFAULT CHARACTER SET ?', $conf['mysql']['database'], $conf['mysql']['charset'])) {

install/lib/update.lib.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,12 @@ function updateDbAndIni() {
125125

126126
//* check sql-mode
127127
$check_sql_mode = $inst->db->queryOneRecord("SELECT @@sql_mode");
128-
if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') die('Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION');
128+
if ($check_sql_mode['@@sql_mode'] != '' && $check_sql_mode['@@sql_mode'] != 'NO_ENGINE_SUBSTITUTION') {
129+
echo "Wrong SQL-mode. You should use NO_ENGINE_SUBSTITUTION. Add\n\n";
130+
echo " sql-mode=\"NO_ENGINE_SUBSTITUTION\"\n\n";
131+
echo"to the mysqld-section in /etc/mysql/my.cnf and restart mysqld afterwards\n";
132+
die();
133+
}
129134

130135
//* Update $conf array with values from the server.ini that shall be preserved
131136
$tmp = $inst->db->queryOneRecord("SELECT * FROM ?? WHERE server_id = ?", $conf["mysql"]["database"] . '.server', $conf['server_id']);

install/uninstall.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
require_once "/usr/local/ispconfig/server/lib/config.inc.php";
3838
require_once "/usr/local/ispconfig/server/lib/app.inc.php";
39-
require "/usr/local/ispconfig/server/mysql_clientdb.conf";
39+
require "/usr/local/ispconfig/server/lib/mysql_clientdb.conf";
4040

4141
//** The banner on the command line
4242
echo "\n\n".str_repeat('-', 80)."\n";
@@ -51,7 +51,7 @@
5151
echo "\n".str_repeat('-', 80)."\n";
5252
echo "\n\n>> Uninstall \n\n";
5353

54-
echo "Are you sure you want to uninsatll ISPConfig? [no]";
54+
echo "Are you sure you want to uninstall ISPConfig? [no]";
5555
$input = fgets(STDIN);
5656
$do_uninstall = rtrim($input);
5757

@@ -62,11 +62,11 @@
6262

6363
$link = mysqli_connect($clientdb_host, $clientdb_user, $clientdb_password);
6464
if (!$link) {
65-
echo "Unable to connect to the database'.mysql_error($link)";
65+
echo "Unable to connect to the database. mysql_error($link)";
6666
} else {
67-
$result=mysqli_query($link,"DROP DATABASE ".$conf['db_database']."';");
67+
$result=mysqli_query($link,"DROP DATABASE ".$conf['db_database'].";");
6868
if (!$result) echo "Unable to remove the ispconfig-database ".$conf['db_database']." ".mysqli_error($link)."\n";
69-
$result=mysqli_query($link,"DROP USER '".$conf['db_user'] ."';");
69+
$result=mysqli_query($link,"DROP USER '".$conf['db_user']."'@'".$conf['db_host']."';");
7070
if (!$result) echo "Unable to remove the ispconfig-database-user ".$conf['db_user']." ".mysqli_error($link)."\n";
7171
}
7272
mysqli_close($link);

interface/web/admin/form/server_ip.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
'ip_address' => array (
122122
'datatype' => 'VARCHAR',
123123
'formtype' => 'TEXT',
124-
'validators' => array ( 0 => array ( 'type' => 'CUSTOME', 'class' => 'validate_server', 'function' => 'check_server_ip',
124+
'validators' => array ( 0 => array ( 'type' => 'CUSTOM', 'class' => 'validate_server', 'function' => 'check_server_ip',
125125
'errmsg'=> 'ip_error_wrong'),
126126
1 => array ( 'type' => 'UNIQUE',
127127
'errmsg'=> 'ip_error_unique'),

0 commit comments

Comments
 (0)