You need to log in firstmysqlThe server sees what encoding it is:
mysql show variables like 'character%';
The following data will appear
| character_set_client | latin1 | | character_set_connection | latin1 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | latin1 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ |
It can be seen from the above information The encoding of the database is latin1;
Among them, character_set_client is the client encoding method; character_set_connection is the encoding used to establish the connection; character_set_database encoding of the database;
character_set_results result set encoding;
character_set_serverThe encoding of the database server;
Just modify the encoding format of sqlyog directly
SET NAMES 'latin1' ;
Create the databaseIt is to set the encoding format:
CREATE DATABASE `ssp` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
【Related recommendations】
1. Free mysql online video tutorial
2. MySQL latest manual tutorial
3. Boolean Education Yan Shiba mysql introductory video tutorial
The above is the detailed content of Share a garbled problem in sqlyog connecting to the database and its solution. For more information, please follow other related articles on the PHP Chinese website!