Home  >  Article  >  Database  >  Share a garbled problem in sqlyog connecting to the database and its solution

Share a garbled problem in sqlyog connecting to the database and its solution

零下一度
零下一度Original
2018-05-29 10:51:172721browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn