mysqlphpmyadminutf8mb4server-variables

phpmyadmin server variables and session values


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.

enter image description here

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.


Solution

  • To establish permanent changes to these, or any other, "Variables":

    1. Edit my.cnf
    2. restart the server (mysqld)
    3. (obviously) you will then need to log in again.

    The flow:

    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).