"Error writing to database" after upgraded to 3.7 latest

Re: "Error writing to database" after upgraded to 3.7 latest

by hugo joe -
Number of replies: 0
This is the debug info when I try to login as user admin:
Debug info: Duplicate entry '4-admin' for key 'mdl_user_mneuse_uix'
INSERT INTO mdl_user (city,auth,username,lang,confirmed,lastip,timecreated,timemodified,mnethostid,calendartype,maildisplay,mailformat,maildigest,autosubscribe,trackforums) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[array (
0 => '',
1 => 'manual',
2 => 'admin',
3 => 'en',
4 => 1,
5 => '192.168.154.1',
6 => 1562138322,
7 => 1562138322,
8 => '4',
9 => 'gregorian',
10 => '2',
11 => '1',
12 => '0',
13 => '1',
14 => '0',
)]
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 111 of /user/lib.php: call to mysqli_native_moodle_database->insert_record()
line 4007 of /lib/moodlelib.php: call to user_create_user()
line 4497 of /lib/moodlelib.php: call to create_user_record()
line 143 of /login/index.php: call to authenticate_user_login()