# Moodle 安装出现数据库错误

**URL:** <https://www.isharkfly.com/t/moodle/3889>\
**Category:** PHP\
**Created:** [September 21, 2012, 2:02am UTC](https://www.isharkfly.com/t/moodle/3889 "2012-09-21T02:02:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [September 21, 2012, 2:02am UTC](https://www.isharkfly.com/t/moodle/3889/1 "2012-09-21T02:02:46Z")

</div>

本帖最后由 maid 于 2012-9-21 10:05 编辑

错误内容如下：[code]Debug info: Cannot execute statement: impossible to write to binary log since BINLOG\_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.  
INSERT INTO mdl\_message\_providers (name,component,capability) VALUES(?,?,?)  
[array (  
0 =\> ‘assign\_notification’,  
1 =\> ‘mod\_assign’,  
2 =\> NULL,  
)]  
Error code: dmlwriteexception  
Stack trace:  
line 410 of \lib\dml\moodle\_database.php: dml\_write\_exception thrown  
line 948 of \lib\dml\mysqli\_native\_moodle\_database.php: call to moodle\_database-\>query\_end()  
line 990 of \lib\dml\mysqli\_native\_moodle\_database.php: call to mysqli\_native\_moodle\_database-\>insert\_record\_raw()  
line 250 of \lib\messagelib.php: call to mysqli\_native\_moodle\_database-\>insert\_record()  
line 614 of \lib\upgradelib.php: call to message\_update\_providers()  
line 358 of \lib\upgradelib.php: call to upgrade\_plugins\_modules()  
line 1524 of \lib\upgradelib.php: call to upgrade\_plugins()  
line 329 of \admin\index.php: call to upgrade\_noncore()

Fatal error: Uncaught exception ‘dml\_write\_exception’ with message ‘Error writing to database’ in E:\works\htdocs\vhosts\demo.ossez.com\httpdocs\p\moodle\lib\dml\moodle\_database.php:410 Stack trace: #0 E:\works\htdocs\vhosts\demo.ossez.com\httpdocs\p\moodle\lib\dml\mysqli\_native\_moodle\_database.php(1151): moodle\_database-\>query\_end(false) #1 E:\works\htdocs\vhosts\demo.ossez.com\httpdocs\p\moodle\lib\dml\moodle\_database.php(1651): mysqli\_native\_moodle\_database-\>delete\_records\_select(‘config’, ‘name = ?’, Array) #2 E:\works\htdocs\vhosts\demo.ossez.com\httpdocs\p\moodle\lib\moodlelib.php(1397): moodle\_database-\>delete\_records(‘config’, Array) #3 E:\works\htdocs\vhosts\demo.ossez.com\httpdocs\p\moodle\lib\upgradelib.php(1259): unset\_config(‘upgraderunning’) #4 E:\works\htdocs\vhosts\demo.ossez.com\httpdocs\p\moodle\lib\upgradelib.php(1244): upgrade\_finished() #5 [internal function]: upgrade\_finished\_handler() #6 {main} thrown in E:\works\htdocs\vhosts\demo.ossez.com\httpdocs\p\moodle\lib\dml\moodle\_database.php on line 410[/code] ![](https://www.isharkfly.com/images/transparent.png)

在 Mysql 下面执行下面的命令：`mysql> SET SESSION binlog_format = 'ROW';
   mysql> SET GLOBAL binlog_format = 'ROW';`就可以解决问题了。
