To modify the database character set:
[... ];
Change the default character set of the table and all character columns (Char,varchar,text) to the new character set:
AlterTABLE tbl_name CONVERT to CHARACTER SET character_name [COLLATE ... ] such as:ALTER TABLE logtest CONVERT to CHARACTER SET UTF8 COLLATE
Utf8_general_ci;
The
Simply modifies the default character set for the table:
alter table tbl_name default character set character_name [< Span style= "font-weight:bold; Color: #993333; " >collate ... alter table logtest default character set UTF8 collate utf8_general_ci;
To modify the character set of a field:
AlterTABLE Tbl_namechange c_name C_name character set Character_name [collate ... alter table logtest change title title varchar (100character set UTF8 collate Utf8_general_ci;
To view the database encoding:
DATABASE db_name;
To view the table encoding:
TABLE tbl_name;
To view field encodings:
from Tbl_name;
Transferred from: blog.sina.com.cn/s/blog_62386810010155pb.html
MySQL modifies the character set of tables, fields, libraries