错误地将查找和替换工具中的数据库写入数据库



我已经将我的moodle数据库文件从旧服务器urlold =(https://example1.com)移到了新服务器urlnew =(https://example2.com)。现在,我想使用Moodle提供的查找和替换数据库表中的URLOLD用URLLOLD替换URLOLD。但是,当我执行操作时,我会遇到此错误。我应该怎么办?请帮忙。

错误我正在得到

Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table = REPLACE(table, 'https://example1.com', 'https://example2.com')' at line 1
UPDATE mdl_pma_history SET table = REPLACE(table, ?, ?)
[array (
0 => 'https://example1.com',
1 => 'https://example2.com',
)]
Error code: dmlwriteexception
Stack trace:
line 426 of /lib/dml/moodle_database.php: dml_write_exception thrown
line 895 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
line 6787 of /lib/adminlib.php: call to mysqli_native_moodle_database->execute()
line 74 of /admin/tool/replace/index.php: call to db_replace()

,所以我自己得到了答案

必须删除导致错误的MDL_PMA_HISTORY表。我遵循的步骤如下。

  • 将表导出到.sql文件
  • 删除了表,因为它不允许脚本运行
  • 一旦脚本(查找和替换)成功导入桌面

完成。

最新更新