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 global log_bin_trust_function_creators = 1 when adding a function in mysql; specify the parameter; otherwise, the function cannot be created.