Warning: (3719, “‘utf8’ is currently an alias for the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.”)
【1】本地版本 Mysql 8.0.12
创建表SQL:
DROP TABLE IF EXISTS students; CREATE TABLE `students` ( `sId` INT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sName` VARCHAR(100) NOT NULL, `sAge` INT(10) NOT NULL, `sAddr` VARCHAR(200) DEFAULT NULL, `sGrade` INT(10) DEFAULT NULL, `sStuId` VARCHAR(20) DEFAULT NULL, `sSex` INT(10) UNSIGNED DEFAULT NULL, PRIMARY KEY (`sId`), INDEX `idx_name` (`sName`) ) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
执行提示警告3719 内容:
Warning: (3719, “‘utf8’ is currently an alias for the character set UTF8MB3, which will be replaced by UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.”)
翻译:
警告:(3719),“UTF 8”目前是字符集UTF8MB3的别名,在将来的版本中将被UTF8MB4替换。请考虑使用UTF8MB4,以便明确无误。“)
【2】解决方案
(1)修改my.ini
[client]
port=3306
default-character-set=utf8mb4
[mysqld]
port=3306
character_set_server=utf8mb4
#解压目录
basedir=D:\MySql\mysql-8.0.12-winx64\bin
#解压目录下data目录
datadir=D:\MySql\mysql-8.0.12-winx64\data
federated
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
(2)修改创建表语句
DROP TABLE IF EXISTS students; CREATE TABLE `students` ( `sId` INT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `sName` VARCHAR(100) NOT NULL, `sAge` INT(10) NOT NULL, `sAddr` VARCHAR(200) DEFAULT NULL, `sGrade` INT(10) DEFAULT NULL, `sStuId` VARCHAR(20) DEFAULT NULL, `sSex` INT(10) UNSIGNED DEFAULT NULL, PRIMARY KEY (`sId`), INDEX `idx_name` (`sName`) ) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4
修改默认字符集 :DEFAULT CHARSET=utf8mb4
不再提示此警告内容。
Good Good Study, Day Day Up.
顺序 选择 循环 总结