Collation_connection stored procedure - utf8mb4_general_ci instead of utf8mb4_unicode_ci using Hiedisql mysql
I am using Hiedisql V9.2.
I am setting the server by default character-set is utfmb4
and collation is utf8mb4_unicode_ci
but after creating the stored procedure it shows collation_connection =utf8mb4_general_ci
.
Below are the my.ini server settings.
[client]
default-character-set = utf8mb4
[mysql]
default-character-set = utf8mb4
[mysqld]
init_connect = 'SET NAMES utf8mb4'
collation-server = utf8mb4_unicode_ci
character-set-server=utf8mb4
SHOW VARIABLES WHERE THEM. Variable_name LIKE 'character_set_%' OR Variable_name LIKE 'collation%';
+--------------------------+--------------------+
| Variable_name | Value |
+--------------------------+--------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| collation_connection | utf8mb4_unicode_ci |
| collation_database | utf8mb4_unicode_ci |
| collation_server | utf8mb4_unicode_ci |
+--------------------------+--------------------+
When the stored procedure is created, it is shown collation_connection=utf8mb4_general_ci
.
SHOW PROCEDURE STATUS where name LIKE 'ProcName'
+----------+----------------------+----------------------+--------------------+
| Name | character_set_client | collation_connection | Database Collation |
+----------+----------------------+----------------------+--------------------+
| ProcName | utf8mb4 | utf8mb4_general_ci | utf8mb4_unicode_ci |
+----------+----------------------+----------------------+--------------------+
So how to fix the error collation_connection=utf8mb4_general_ci
.
I want to collation_connection=utf8mb4_unicode_ci
.
Finally I have a problem. This is a question of the Hiedisql tool I am using. Hiedisql toolkit collation_connection=utf8mb4_general_ci
before running script.
How to fix:
Just set the variable below before running any script.
SET collation_connection = @@collation_database;
OR
SET collation_connection = 'utf8mb4_unicode_ci';
Note. If you want to know what the actual mapping is, use it mysql command prompt
, it will return the actual result.