To modify the database character set:
ALTER DATABASE db_name DEFAULT CHARACTER SET [COLLATE ... ];
Change the default character set of the table and all character columns (Char,varchar,text) to the new character set:
ALTER TABLE CONVERT to CHARACTER SET [COLLATE ... ] such as:ALTERTABLECONVERTtoCHARACTER SET UTF8 COLLATE utf8_general_ci;
Just modify the default character set for the table:
ALTER TABLE DEFAULT CHARACTER SET [COLLATE ... ], such as:ALTERTABLEDEFAULTCHARACTERSET UTF8 COLLATE Utf8_general_ci;
To modify the character set of a field:
ALTER TABLE CHARACTER SET [COLLATE ... ]; For example:ALTERTABLEVARCHAR(CHARACTER SET UTF8 COLLATE utf8_general_ci;
To view the database encoding:
CREATE DATABASE db_name;
To view the table encoding:
CREATE TABLE tbl_name;
To view field encodings:
Full from Tbl_name;
MySQL modifies the character set of tables, fields, libraries