1024programmer Mysql What should I do if mysql cannot store Chinese character strings?

What should I do if mysql cannot store Chinese character strings?

The solution that mysql cannot store Chinese character strings: first change the character set of the database and tables to utf8; then delete the relevant fields and recreate them; finally use SQL statements to modify the character set to utf8.

Of course, we can also use SQL statements to modify the character set:

alter database  test default character set = utf8; // test is the database name
 alter table test.bd_user default character set = utf8; // bd_user is the table name
 alter table test.bd_user modify column user_name varchar(20) character set utf8 collate utf8_general_ci; // The field type will also be changed here

The above are the details of how mysql cannot store Chinese character strings, more please Follow other related articles on 1024programmer.com!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/what-should-i-do-if-mysql-cannot-store-chinese-character-strings/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索