2016-12-30 21 views
0

我已將我的moodle數據庫文件從舊服務器URLold =(https://example1.com)移至新服務器URLnew =(https://example2.com)。現在我想用使用moodle提供的查找和替換工具在數據庫表中替換URLold。但是當我執行操作時,我收到這個錯誤。我該怎麼辦?請幫忙。在查找和替換工具中向Moodle中的數據庫寫入錯誤

錯誤我得到

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() 

回答

0

所以我得到了我自己的

不得不刪除這是導致錯誤的mdl_pma_history表的答案。我遵循的步驟如下。

  • 導出表.SQL文件
  • 刪除的表,因爲它沒有允許腳本運行
  • 一旦腳本(查找和替換)跑成功導入 表背

完成。