Installing Moodle 3.2.1+ (DDL sql execution error)

Installing Moodle 3.2.1+ (DDL sql execution error)

by Foo Lam Wong -
Number of replies: 1

Hi all,

I am trying to do a fresh install of Moodle 3.2.1+ (Build: 20170209) on a Ubuntu 16.04 LTS Linux server connecting to MariaDB (Server version: 10.1.21-MariaDB-1~xenial).

When I try installing 3.2, i am getting the following error:


DDL sql execution error

......

Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CREATE TABLE mdl_config_plugins (

id BIGINT(10) NOT NULL auto_increment,

' at line 13

CREATE TABLE mdl_config (

id BIGINT(10) NOT NULL auto_increment,

name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',

value LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,

CONSTRAINT PRIMARY KEY (id)

, UNIQUE KEY mdl_conf_nam_uix (name)

)

ENGINE = InnoDB

DEFAULT CHARACTER SET utf8

DEFAULT COLLATE = utf8_unicode_ci

COMMENT='Moodle configuration variables'

;

CREATE TABLE mdl_config_plugins (

id BIGINT(10) NOT NULL auto_increment,

plugin VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'core',

name VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',

value LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,

CONSTRAINT PRIMARY KEY (id)

, UNIQUE KEY mdl_confplug_plunam_uix (plugin, name)

)

ENGINE = InnoDB

DEFAULT CHARACTER SET utf8

DEFAULT COLLATE = utf8_unicode_ci

COMMENT='Moodle modules and plugins configuration variables'

;

......

......

CREATE TABLE mdl_competency_modulecomp (

id BIGINT(10) NOT NULL auto_increment,

cmid BIGINT(10) NOT NULL,

timecreated BIGINT(10) NOT NULL,

timemodified BIGINT(10) NOT NULL,

usermodified BIGINT(10) NOT NULL,

sortorder BIGINT(10) NOT NULL,

competencyid BIGINT(10) NOT NULL,

ruleoutcome TINYINT(2) NOT NULL,

CONSTRAINT PRIMARY KEY (id)

, KEY mdl_compmodu_cmirul_ix (cmid, ruleoutcome)

, UNIQUE KEY mdl_compmodu_cmicom_uix (cmid, competencyid)

, KEY mdl_compmodu_cmi_ix (cmid)

, KEY mdl_compmodu_com_ix (competencyid)

)

ENGINE = InnoDB

DEFAULT CHARACTER SET utf8

DEFAULT COLLATE = utf8_unicode_ci

COMMENT='Link a competency to a module.'

Error code: ddlexecuteerror

×Stack trace:

line 485 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown

line 919 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()

line 77 of /lib/ddl/database_manager.php: call to mysqli_native_moodle_database->change_database_structure()

line 425 of /lib/ddl/database_manager.php: call to database_manager->execute_sql_arr()

line 370 of /lib/ddl/database_manager.php: call to database_manager->install_from_xmldb_structure()

line 1621 of /lib/upgradelib.php: call to database_manager->install_from_xmldb_file()

line 275 of /admin/index.php: call to install_core()


May i know how can i resolve this issue?


Regards,

Foo Lam


Average of ratings: -
In reply to Foo Lam Wong

Re: Installing Moodle 3.2.1+ (DDL sql execution error)

by Joël Schmid -

Maybe try logging into MariaDB and choosing a database and try to create a table manually.

mysql -u root -p
use moodle; #DB name
# Create Table:

CREATE TABLE mdl_config (

id BIGINT(10) NOT NULL auto_increment,

name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '',

value LONGTEXT CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,

CONSTRAINT PRIMARY KEY (id)

)


Furthermore check out this link, they seam to have the same error message: https://moodle.org/mod/forum/discuss.php?d=214752