frumbert / wp2moodle-moodle

Moodle end of a Wordpress to Moodle Single Sign On auth plugin
28 stars 29 forks source link

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

Open pedromarinelli opened 6 years ago

pedromarinelli commented 6 years ago

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

Info

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 => 'pedromarinelli@email.com', 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.

harshmanvar commented 5 years ago

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

pedromarinelli commented 5 years ago

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

harshmanvar commented 5 years ago

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