View the current connection system parameters: Show variables like '% char % ';
Mysql> show variables like 'Char % ';
+ -------------------------- + ----------------
| Variable_name | value
+ -------------------------- + ----------------
| Character_set_client | GBK
| Character_set_connection | GBK
| Character_set_database | Latin1
| Character_set_filesystem | binary
| Character_set_results | GBK
| Character_set_server | Latin1
| Character_set_system | utf8
| Character_sets_dir | C :/
+ -------------------------- + ----------------
8 rows in SET (0.00 Sec)
Mysql>
The database and server character set can only be set to utf8 in the configuration file, otherwise it does not work
In the command line: Stop command: net stop MySQL
Start command: Net start MySQL
MySQL core configuration file my. ini
[MySQL] mainly configures the command line Client parameter default-character-set = utf8 ---- affects the client, connection, and result
[Mysqld] configuring the server parameter character-set-Server = utf8 ----- affects Database Server
Set set global log_bin_trust_function_creators = 1 when adding a function in MySQL; specify the parameter; otherwise, the function cannot be created.