search

Home  >  Q&A  >  body text

Ask the master about the problem of converting UTF8 encoding from MYSQL GBK

Requirements:

A remote table userinfo_remote, database encoding gbk, proofreading set is gbk_chinese_ci, fields (uid, username, password, email,... others) where username is the only index

It is necessary to take certain fields (uid, username, password) from the remote table, and then write them into the local table userinfo_local. The local table encoding is utf8, and the proofing set is utf8_general_ci, in which username is the only index.

Question:

In the remote database, it was found that there are users such as the following users

uid=12, username=coco,

uid=234, username=CǒCǒ,

in When writing to the local database, a duplicate username error is reported, such errors are reported, and there are others.

Solution: Without changing the proofing set (because userinfo_local will be used as a new user table later in the project) There is a user registration function, but I hope to still maintain the case-insensitive requirement), how to transfer the data of the remote table to the new table~~~~? I beg the master

实力单身典范实力单身典范1947 days ago960

reply all(0)I'll reply

No reply
  • Cancelreply