时间:2021-07-01 10:21:17 帮助过:23人阅读
ALTER TABLE tbl_name CONVERT TO CHARACTER SET character_name [COLLATE …]
如:ALTER TABLE logtest CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;此处写utf8_general_ci有时候会报错,直接写utf8即可
alter table logtest convert to character set utf8;
ALTER TABLE tbl_name DEFAULT CHARACTER SET character_name [COLLATE…];
如:ALTER TABLE logtest DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE tbl_name CHANGE c_name c_name CHARACTER SET character_name [COLLATE …];
如:ALTER TABLE logtest CHANGE title title VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_general_ci;
SHOW CREATE DATABASE db_name;
SHOW CREATE TABLE tbl_name;
SHOW FULL COLUMNS FROM tbl_name;
mysql修改表、字段、库的字符集
标签:chart efault 字段 mysq block char mysql tab cte