Get the App
SLTechnology News&Howtos  ›  Database  › 

What are the problems in building tables in Chinese in MySQL

Shulou Source: shulou.com Published: 2022-05-31 18:50:54 10月03日 Update

This article mainly explains the "MySQL Chinese table building will be what problems", the article explained the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "MySQL Chinese table building will be what problems" bar!

For example, when the system is developed on a personal PC, the database has a lot of initialization data, and when the system development is completed, the initialization data should be exported into SQL scripts from the PC, and the database initialization can be completed by importing these SQL scripts on the server.

However, the import of Chinese characters has become a big problem, import Chinese, the data is always wrong "DatatoolongforcolumnXXatrown"

This problem has been bothering me. Due to the small amount of data in the past, there is no need to import function, so I can only reinitialize it again. Now I can't. There is so much initialization data that it is impossible to reinitialize it, but I always thought there must be a way to solve this problem. Today, I spent most of my time looking for information on the Internet, and this problem has been basically solved.

What are the problems in building tables in Chinese in MySQL

In order to describe this problem clearly, it is explained in detail as follows:

1. Build a database

MicrosoftWindowsXP [version 5.1.2600]

Copyright 1985-2001MicrosoftCorp.

C:\ DocumentsandSettings\ awish > mysql-uroot-p

Enterpassword:*

WelcometotheMySQLmonitor.Commandsendwith;or\ g.

YourMySQLconnectionidis24toserverversion:5.0.27-community-nt

Type'help;'or'\ hype forhelp.Type'\ c'toclearthebuffer.

Mysql > createdatabasetest

two。 Set data encoding to utf8

Mysql > usetest;Databasechangedmysql > setnamesutf8;// sets the database character set to utf8QueryOK,0rowsaffected (0.00sec)

3. Create a datasheet

Mysql > CREATETABLEperson- > (- > idINT (8) NOTNULLAUTO_INCREMENTPRIMARYKEY,- > namevarchar (16) default'nobody',- > birthdaychar (19),->) ENGINE=InnoDBDEFAULTCHARSET=utf8// creates a data table with the character set set to utf8- >; QueryOK,0rowsaffected (0.03sec)

Thank you for your reading, the above is the content of "what problems will occur in MySQL Chinese table building". After the study of this article, I believe you will have a deeper understanding of what problems will occur in MySQL Chinese table building, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Data problem Chinese database character learning content datasheet system script development no clear big no personal method function character set that is Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Xiaomi Microsoft Linux Docker