The following articles mainly talk about the actual steps of MySQL encoding conversion and MySQL encoding conversion. I found a piece of information about MySQL encoding conversion on a reputable website for your sharing, I hope it will help you in this regard.
Many modern applications support multiple languages. Therefore, if MySQL is used in the database, utf8 encoding is generally recommended to store multilingual data. Another reason is that most development languages such as. NET and JAVA currently use unicode processing programs in the program itself. MySQL can avoid Code Conversion between databases and programs after utf8 is used.
MySQL encoding and conversion 1. Server encoding settings.
MySQL server 5 can select the database encoding when installing it in windows, but it does not work in linux. The default encoding is litan1. Therefore, you need to modify the configuration file, in windows, the configuration file is my. ini, the configuration file in linux is/etc/my. cnf: Add default-character-set = utf8 to [client] and [MySQLd] respectively, restart the service (the command is service MySQL restart in linux), and enter show under MySQL>, in the result, all character_set_xxxx values are displayed as utf8, indicating that the configuration is successful.
MySQL encoding and conversion 2. Application configuration.
Java: jdbc: MySQL: // 192.168.1.231: 3306/dbname? UseUnicode = true & characterEncoding = UTF-8
Net: Server = 127.0.0.1; Database = dbname; User Id = root; Password = 123456; Charset = utf8
Change the ip address and dbname to the one specified by the system.
MySQL encoding conversion 3. Existing database encoding conversion.
If some databases use litan1 encoding, You need to convert it to utf8 for better use.
A. MySQLdump -- default-character-set = latin1-uroot-p123456 dbname> 1. SQL
B. Use editplus or another editing tool to open 1.sqland convert latin1 to utf8. (The data cannot be imported after being converted using ultraedit in the test. I do not know the reason ).
C. MySQL-u root-p 123456 dbname <1. SQL
Import the converted SQL file to the new database.