Skip to content
This repository has been archived by the owner on Aug 8, 2019. It is now read-only.

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

Open
pedromarinelli opened this issue Sep 18, 2018 · 3 comments

Comments

@pedromarinelli
Copy link

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.

@harshmanvar
Copy link

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

@pedromarinelli
Copy link
Author

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

@harshmanvar
Copy link

harshmanvar commented Jun 21, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants