I’m experiencing an error while trying to create a new website via CyberPanel. The process fails and shows the following error message:
[“(1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8mb3_general_ci,COERCIBLE) for operation ‘=’") [404]”]
Error while creating a website – Illegal mix of collations (latin1_swedish_ci vs utf8mb3_general_ci)
what is your domain?
tomeofmadness-demos.gr
The issue is a database collation mismatch. This typically happens when the database was created with different character set settings than what
CyberPanel expects. Here’s how to fix it:
Option 1: Quick Fix via phpMyAdmin
-
Access phpMyAdmin through CyberPanel
-
Select the cyberpanel database
-
Run this SQL command:
ALTER DATABASE cyberpanel CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -
Then update the affected tables:
ALTER TABLE websiteFunctions_websites CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE websiteFunctions_childdomains CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Option 2: Via Command Line
mysql -u root -p cyberpanel -e “ALTER DATABASE cyberpanel CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;”
mysql -u root -p cyberpanel -e “ALTER TABLE websiteFunctions_websites CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;”
mysql -u root -p cyberpanel -e “ALTER TABLE websiteFunctions_childdomains CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;”
Why This Happened:
- The error occurs because the database or tables were created with latin1_swedish_ci collation (MySQL’s old default)
- When CyberPanel tries to compare the domain name (which contains UTF-8 characters like in Greek domains), it fails due to collation mismatch
- The domain tomeofmadness-demos.gr likely triggered this because it’s being compared against existing data with different collation
Prevention:
To prevent this in the future, ensure MariaDB/MySQL default character set is UTF-8:
- Edit /etc/mysql/mariadb.conf.d/50-server.cnf
- Add under [mysqld]:
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci - Restart MariaDB: systemctl restart mariadb
This is a one-time database configuration issue, not a bug in CyberPanel itself.
This topic was automatically closed 3 hours after the last reply. New replies are no longer allowed.