Hello, I am trying to install Moodle 4.5.4, and every time this error appears. I have already created several different databases and tried changing the prefix. But this error keeps showing up...
MySQL 8.0.0, PHP 8.1
Here is part of the error.
Nginx 1.26.3
I try install with this instructions:: https://docs.moodle.org/2x/ca/Step_by_Step_Installation_on_a_Mac_OS_X_Server
Moodle code was downloading from: https://download.moodle.org/releases/supported/
Here is part of the error.
Can you share the rest of the definition of mdl_course that's chopped at the bottom:
It would be useful to see the bit like:
`role` bigint(10),
CONSTRAINT PRIMARY KEY (`id`)
, KEY `mdl_courcompcrit_cou_ix` (`course`)
MySQL 8.0.0
Really? Version 8.0.0 is from 2018, the latest 8.0.x is 8.0.41.
Perfect, thank you.
I asked for the definition of mdl_course by mistake, I should have asked for mdl_course_completion_criteria. From this error we can see that the definition for mdl_course_completion_criteria is:
CREATE TABLE mdl_course_completion_criteria (
id BIGINT(10) NOT NULL auto_increment,
⋮
role BIGINT(10),
CONSTRAINT PRIMARY KEY (id)
, KEY mdl_courcompcrit_cou_ix (course)
)
The error is caused by your old version of MySQL, in MySQL 8.0.0 role was a reserved word not allowed for column names. This was changed in MySQL 8.0.1 so you must use at least this version.