Error writing to database during installation v2.2.1

Error writing to database during installation v2.2.1

Andrew Steele -
回帖数:13

I am just attempting to install a new instance of Moodle using v2.2.1

I've successfully installed multiple Moodles in the past but the version 2.2.1 instances were all upgrades from v1.9.  This is a clean installation.

The process checks the system and it passes all the tests.  A short pause after clicking the button to proceed and an Error writing to database is declared. I'm using MySQL.

The error states:

Debug info: Binary logging not possible. Message: Transaction level 'READ-COMMITTED' in InnoDB is not safe for binlog mode 'STATEMENT'
INSERT INTO mdl_message_providers (name,component,capability) VALUES(?,?,?)
[array (
0 => 'notices',
1 => 'moodle',
2 => 'moodle/site:config',
)]
Stack trace:
  • line 397 of /lib/dml/moodle_database.php: dml_write_exception thrown
  • line 893 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 935 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 248 of /lib/messagelib.php: call to mysqli_native_moodle_database->insert_record()
  • line 1353 of /lib/upgradelib.php: call to message_update_providers()
  • line 174 of /admin/index.php: call to install_core()

I'm entirely stuck and not sure where to head with this. Can anyone point me in the right direction?

Thanks.

Andrew

回复Andrew Steele

Re: Error writing to database during installation v2.2.1

Brian Lockwood -

What's your Mysql versions and is your my.cnf set up with the correct default options.

回复Brian Lockwood

Re: Error writing to database during installation v2.2.1

Andrew Steele -

I'm not sure I know how to fully answer the question...

Webmin tells me that I have MySQL version 5.1.41.

I'm not sure what I would looking for in the my.cnf file so it is attached in case anyone has any insights.

Andrew

回复Andrew Steele

Re: Error writing to database during installation v2.2.1

Naceur Bouziani -

Hi Andrew !

This looks like the same error I pointed out in my message. Yes guys any help would be great from you.

I'm using mysql 5.0.90 and php 5.4.0.1

Naceur

回复Naceur Bouziani

Re: Error writing to database during installation v2.2.1

Andrew Steele -

I think I've identified the issue as a MYSQL configuration setting.  I'm having some difficulty getting things set correctly...

 

Take a look at http://is.gd/yXhDT9

回复Andrew Steele

Re: Error writing to database during installation v2.2.1

Andrew Steele -

Seem to have got this sorted by adding the following two lines to the my.cnf

Andrew

# Format is "statement" by default
binlog_format = row
回复Andrew Steele

Re: Error writing to database during installation v2.2.1

Rudy Scott -

If you are stuck on shared hosting and have this problem (and your host won't change this configuration setting), you can also change the isolation mode used by Moodle.  

Look in:

moodle\lib\dml\mysqli_native_moodle_database.php

Search for:

READ COMMITTED

Replace with:

REPEATABLE READ



回复Rudy Scott

Re: Error writing to database during installation v2.2.1

Manoj Rajiwadekar -

Rudy,

Your remedy worked like a charm for me. I had moodle 1.9 but I couldn't install moodle 2 and above on shared hosting of Netfirms. I was struggling with it for last almost a year. Thanks a lot sir. I am too happy now as I wanted Moodle 2.6 desparately. 

回复Rudy Scott

Re: Error writing to database during installation v2.2.1

James Miller -

The edits into moodle\lib\dml\mysqli_native_moodle_database.php to replace the READ COMMITTED with REPEATABLE READ didn't work for me.


I'm hosting on iPage (which has been a disaster..) if anyone has suggestions.  THe php.ini directives for the binlog_format to ROW don't take for the instance and I'm out of options.

Site is being upgraded, please retry later.
Debug info: 
Error code: upgraderunning
Stack trace:
  • line 463 of /lib/setuplib.php: moodle_exception thrown
  • line 674 of /lib/setup.php: call to print_error()
  • line 33 of /config.php: call to require_once()
  • line 77 of /admin/index.php: call to require()
回复Rudy Scott

Re: Error writing to database during installation v2.2.1

pete kater -

Dear Rudy,


Thanks! That solved my installation problem of moodle [0], too.

Perfect


[0] version.php:

defined('MOODLE_INTERNAL') || die();

$version  = 2014111002.00;              // 20141110      = branching date YYYYMMDD - do not modify!
                                        //         RR    = release increments - 00 in DEV branches.
                                        //           .XX = incremental changes.

$release  = '2.8.2 (Build: 20150112)'; // Human-friendly version name

$branch   = '28';                       // This version's branch.
$maturity = MATURITY_STABLE;             // This version's maturity level.

回复Andrew Steele

Re: Error writing to database during installation v2.2.1

samudaya Nanayakkara -

Hi Andrew,

I also had the same issue and your solution works great.....

Thanks and Best Regards

Samu