[mysqld] character-set-server=utf8mb4 [mysql] default-character-set=utf8mb4
只要修改my.ini(位置:C:ProgramDataMySQL)文件,然后重启mysql服务即可.
注意数据库的编码为utf8mb4
SHOW VARIABLES LIKE 'character_set%';
[mysqld] character-set-server=utf8mb4 [mysql] default-character-set=utf8mb4
只要修改my.ini(位置:C:ProgramDataMySQL)文件,然后重启mysql服务即可.
注意数据库的编码为utf8mb4
SHOW VARIABLES LIKE 'character_set%';
SELECT COLUMN_NAME AS 列名, cast(COLUMN_TYPE as CHAR) AS 数据类型, cast(DATA_TYPE as CHAR) AS 字段类型, CHARACTER_MAXIMUM_LENGTH AS 长度, IS_NULLABLE AS 是否为空, COLUMN_DEFAULT AS 默认值, COLUMN_COMMENT AS 备注 FROM INFORMATION_SCHEMA. COLUMNS WHERE table_schema = 'tobacco_asset' AND table_name = 'asset_base'
这样可以查出对应的表格每个字段的信息