Page 1 of 1

The problem with userlevelpermissions and utf8mb4

Posted: Thu Jun 22, 2017 6:33 pm
by btrade

Hi,
I have datebase

ENGINE = INNODB
CHARACTER SET utf8mb4
COLLATE utf8mb4_unicode_ci;

If I Creating a Table for Dynamic User Levels - I see the error
Specified key was too long; max key length is 767 bytes

Without it my app has mysql error IN LOGIN PAGE
( ! ) Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='' in J:\home\translator\www\backoffice\ewmysql13.php on line 720


Re: The problem with userlevelpermissions and utf8mb4

Posted: Sat Jun 24, 2017 5:08 pm
by Webmaster

btrade wrote:
'Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=''

Try to use utf8_general_ci as your database charset, not utf8mb4_unicode_ci.


Re: The problem with userlevelpermissions and utf8mb4

Posted: Sat Jun 24, 2017 6:17 pm
by btrade

Webmaster wrote:
Try to use utf8_general_ci as your database charset, not utf8mb4_unicode_ci.
This is old charset utf8_general_ci and now in userlevelpermissions only.
If I want to change charset to utf8mb4_unicode_c , i have error: Specified key was too long; max key length is 767 bytes.


Re: The problem with userlevelpermissions and utf8mb4

Posted: Sat Jun 24, 2017 11:01 pm
by Webmaster

btrade wrote:
This is old charset utf8_general_ci and now in userlevelpermissions only.

Not sure what that means. Did you mean you use different charset for different tables? Please provide complete information.

If I want to change charset to utf8mb4_unicode_ci

Why utf8mb4_unicode_ci?


Re: The problem with userlevelpermissions and utf8mb4

Posted: Wed Jul 19, 2017 8:52 pm
by btrade

My old project and datebase was in utf8_general_ci
In a new project I use 20 languages and I need utf8mb4_unicode_ci.

Sorry. The problem is not solved.


Re: The problem with userlevelpermissions and utf8mb4

Posted: Fri Jul 21, 2017 12:47 am
by sangnandar

This table use varchar type as key.
Now, you may want to check, each varchar character consume different byte in different charset. Shorten your varchar size will solve your problems.