Skip to content

Commit 2b3b4cf

Browse files
author
Florian Schaal
committed
more detaled informations during install/setup when mysql is not using NO_ENGINE_SUBSTITUTION
1 parent 99fcaa5 commit 2b3b4cf

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
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']);

0 commit comments

Comments
 (0)