Hi,
We are running 3.1.7 & are about to upgrade to 3.3.3+ with approx 9500 users.
While running the $ php admin/cli/mysql_collation.php --collation=utf8mb4_unicode_ci script in test I've got:
ALTER TABLE mdl_user
MODIFY COLUMN username varchar(100)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''
Error code: ddlexecuteerror
* line 485 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
* line 1000 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 190 of /admin/cli/mysql_collation.php: call to mysqli_native_moodle_database->change_database_structure()
!!! DDL sql execution error !!!
!! Duplicate entry '11-kï½ï½šï½•ï½“1' for key 'mdl_user_mneuse_uix'
ALTER TABLE mdl_user
MODIFY COLUMN username varchar(100)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT ''
Error code: ddlexecuteerror !!
!! Stack trace: * line 485 of /lib/dml/moodle_database.php: ddl_change_structure_exception thrown
* line 1000 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
* line 190 of /admin/cli/mysql_collation.php: call to mysqli_native_moodle_database->change_database_structure()
!!
If I run the query as root directly against MySQL (I'm not a MySQL expert in any form!):
ALTER TABLE mdl_user
MODIFY COLUMN username varchar(100)
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci NOT NULL;
I get:
Error Code: 1062. Duplicate entry '11-kozus1' for key 'mdl_user_mneuse_uix'
But I cant find a user "11-kozus1" either via MySQL or Moodle admin (including checking for '11% in MySQL'), so where do I go from here?
Cheers