Home > Database > Mysql Tutorial > body text

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

零下一度
Release: 2018-05-29 10:51:17
Original
2729 people have browsed it

You need to log in firstmysqlThe server sees what encoding it is:

mysql
show variables like 'character%';
Copy after login

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/ |
Copy after login

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'  ;
Copy after login

Create the databaseIt is to set the encoding format:

CREATE DATABASE `ssp` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Copy after login

【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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template