Mysql encoding, data table encoding view and modification Summary 1. view the mysql encoding that you have installed 2. view the Mysql supported encoding 3. view the database encoding 4. view the data table encoding (showcreatetableuserG ;) 5. modify my. INI file to modify the encoding: add the default-character-set character set (utf8.gbk. gb2312, etc.) 6,
Summary of viewing and modifying mysql encoding and data table encoding 1, view the mysql encoding that you have installed 2. view the encoding supported by Mysql 3. view the database encoding 4. view the data table encoding (show create table user \ G;) 5. modify my. INI file to modify the encoding: Add default-character-set = character set (utf8.gbk. gb2312, etc.) 6,
Summary of viewing and modifying mysql encoding and data table Encoding
1. Check the encoding of your installed mysql.
2. Check the encoding supported by Mysql.
3. view the database code
4. view the data table encoding (show create table user \ G ;)
5. Modify the my. ini file to modify the encoding: add the default-character-set = character set (utf8.gbk. gb2312, etc)
6. Modify the command line: alter database da_name default character set 'charset'; or set names 'charset'; or alter database testdb character set utf8;
8. view the character set of the Database Service and client:
9. Modifications in Linux:
1) Export data
Root@www.cnscn.org ~ $ Mysqldump-u root-p dbname -- default-character-set = gbk> base_user. SQL;
2) view the exported SQL file encoding
Root@www.cnscn.org ~ $ File base_user. SQL
Base_user. SQL: UTF-8 Unicode text, with very long lines
3) convert to the encoding to be used
Root@www.cnscn.org ~ $ Iconv-f UTF-8-t gbk base_user. SQL> base_user_gbk. SQL
4) connect to the database and view the encoding of the current database
Root@www.cnscn.org ~ $ Mysql-uroot
Mysql> use testdb;
Mysql> status;
Server characterset: latin1
Db characterset: gbk
Client characterset: latin1
Conn. characterset: latin1
5) set it to the required encoding.
Mysql> set names 'gbk ';
6) view the current Encoding
Mysql> status;
Server characterset: latin1
Db characterset: gbk
Client characterset: gbk
Conn. characterset: gbk
7) import the file converted to gbk
Mysql> source base_user_gbk. SQL;