SHOW VARIABLES WHERE Variable_name LIKE ‘character_set_%‘ OR Variable_name LIKE ‘collation%‘;
SET character_set_client = utf8mb4;
SET character_set_connection = utf8mb4;
SET character_set_database = utf8mb4;
SET character_set_results = utf8mb4;
SET character_set_server = utf8mb4;
ALTER DATABASE 数据库名 CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE tableName CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE tableName CHANGE `content` `content` LONGTEXT CHARACTER SET utf8mb4
另外my.ini(此文件在tomcat安装目录和bin在同级)文件要修改这几处: