I'm going to use utf8mb4
. Also some of my variables must be utf8mb4 that mentioned here. I set them from phpmyadmin Variables
menu. But some of changes to utf8mb4 but it's session value is still uft8
.
And when I run this command:
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%'
That show me utf8, not utf8mb4. Any idea?
EDIT: When I set the a variable to utf8
, session value disapear.
To establish permanent changes to these, or any other, "Variables":
my.cnf
The flow:
GLOBAL VARIABLES
.SESSION VARIABLES
; these are used by your connection.SET
, it will modify only your session variable. The value will be lost when the connection closes.Another note on utf8mb4... Most client software (php, phpmyadmin, etc) has a way of setting the CHARACTER SET
and COLLATION
for the connection. This is when you should establish that "the bytes in the client are "UTF-8" encoded. (The outside world calls it UTF-8; MySQL calls the same thing utf8mb4.)
Update: MySQL 8.0 has an optional way to make the setting of GLOBAL VARIABLES
"persist", thereby bypassing step 2 (restart).