【1】本地版本 Mysql 8.0.12mysql
建立表SQL: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 內容:ide
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.」)spa
翻譯:翻譯
警告:(3719),「UTF 8」目前是字符集UTF8MB3的別名,在未來的版本中將被UTF8MB4替換。請考慮使用UTF8MB4,以便明確無誤。「)code
【2】解決方案server
(1)修改my.iniblog
[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_TABLESclass
(2)修改建立表語句cli
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.
順序 選擇 循環 總結