0

我正在安装moodle(2.2或2.5)并修改了sql generator.php以具有外键并映射数据库以供研究建议,我总是得到这个,顺便说一下我正在使用5.5.27 - MySQL Community Server

调试信息:表 'config' 已经存在 CREATE TABLE config (id BIGINT(10) NOT NULL auto_increment, name VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL DEFAULT'', value LONGTEXT CHARACTER SET utf8 COLLATE utf8_spanish_ci NOT NULL, CONSTRAINT PRIMARY KEY (id) ) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 DEFAULT COLLATE = utf8_spanish_ci 错误代码:ddlexecuteerror 堆栈跟踪:

line 429 of \lib\dml\moodle_database.php: ddl_change_structure_exception thrown
line 842 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 88 of \lib\ddl\database_manager.php: call to mysqli_native_moodle_database->change_database_structure()
line 77 of \lib\ddl\database_manager.php: call to database_manager->execute_sql()
line 417 of \lib\ddl\database_manager.php: call to database_manager->execute_sql_arr()
line 369 of \lib\ddl\database_manager.php: call to database_manager->install_from_xmldb_structure()
line 1479 of \lib\upgradelib.php: call to database_manager->install_from_xmldb_file()
line 203 of \admin\index.php: call to install_core()

我发现这是https://tracker.moodle.org/browse/MDL-20437的一个小错误,无论如何它适用于 1.9 版,但这不是我尝试安装的版本

到目前为止我已经搜索过,没有解决方案!有人真的解决了这个问题吗

4

1 回答 1

1

看来,您将表命名为“config”,这是一个很大的 NO-NO。你应该在你的表名前加上你的模块名。例如,如果你的模块被称为“mymodule”,它的配置表名应该是“mymodule_config”。我希望,这可以为您解决问题。

有关更多信息,请参阅此 Moodle 开发 wiki 文章

于 2014-01-02T07:15:09.347 回答