The solution method of Chinese garbled in form input data in Mysql _mysql

Source: Internet
Author: User
Tags mysql in create database

MySQL will appear in Chinese garbled because

1.server itself set the problem, generally is latin1

2. No coding format was developed for the construction of the database.

MySQL in the form of input data appear in Chinese garbled solution:

1. When building a library

CREATE DATABASE test 
CHARACTER SET ' UTF8 ' 

2. When building a table

CREATE TABLE content ( 
text VARCHAR (100)

Basically there will be no problem, that is, the same encoding format is used to build the library and build the table.

1. View the default encoding format:

 
 

The following is a modified

Mysql> Show variables like "%char%"; 
+--------------------------+---------------------------------------------------------+
| variable_name | Value |
+--------------------------+---------------------------------------------------------+
| character_set_ Client | UTF8 |
| character_set_connection | UTF8 |
| Character_set_database | UTF8 |
| Character_set_filesystem | binary |
| Character_set_results | UTF8 |
| Character_set_server | UTF8 |
| Character_set_system | UTF8 |
| Character_sets_dir | /usr/local/mysql-5.7.13-osx10.11-x86_64/share/charsets/|
+--------------------------+---------------------------------------------------------+

2. View the encoding format of the test database:

The above is a small set to introduce the MySQL in the form of data entry in the table of Chinese garbled solution, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.