Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the problems in building tables in Chinese in MySQL

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report