wp2moodle-moodle icon indicating copy to clipboard operation
wp2moodle-moodle copied to clipboard

Error writing to database - Error code: dmlwriteexception | Shared Host

Open pedromarinelli opened this issue 6 years ago • 3 comments

Hi, I'm having an error authenticating a login between Wordpress and Moodle 3.5.

Info

  • Wordpress 4.9.8 (DB MySQL)
  • Moodle 3.5 (DB MySQL)
  • Shared Host (hostgator)
  • PHP 7

The error:

Error writing to database Other information about this error

Debug info: Duplicate entry '1-12345678900' for key 'mdl_user_mneuse_uix' INSERT INTO mdl_user (city,auth,policyagreed,idnumber,username,password,firstname,lastname,email,lang,confirmed,lastip,timecreated,timemodified,mnethostid) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [array ( 0 => '', 1 => 'wp2moodle', 2 => 1, 3 => '1584', 4 => '12345678900', 5 => 'a803bc70a48ce4568a9e85f7e1e30c58', 6 => 'Pedro', 7 => 'Marinelli', 8 => '[email protected]', 9 => 'pt_br', 10 => 1, 11 => '177.192.193.143', 12 => 1537303059, 13 => 1537303059, 14 => '1', )] Error code: dmlwriteexception

Stack trace: line 489 of /lib/dml/moodle_database.php: dml_write_exception thrown line 1329 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end() line 1375 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw() line 232 of /auth/wp2moodle/login.php: call to mysqli_native_moodle_database->insert_record()


With some research I found solutions configuring the file my.cfg or binlog_format via phpmyadmin. But as I said my is a shared host and this is not an option at the moment. Do you think some other solution is possible?

Thanks.

pedromarinelli avatar Sep 18 '18 21:09 pedromarinelli

I am facing same error issue user is not able to login can you please help.

harshmanvar avatar Jun 18 '19 05:06 harshmanvar

Sorry but this project has been discontinued and I can not remember if we have a solution to this problem. ^^"

pedromarinelli avatar Jun 21 '19 04:06 pedromarinelli

Thankyou for writing back.

I have solved the issue it was database collation issue i follow this documentation and changed the all tables collations and it's fine. document : https://docs.moodle.org/37/en/MySQL_full_unicode_support

harshmanvar avatar Jun 21 '19 04:06 harshmanvar