Integer display width is deprecated

来源:2-7 完整性约束条件介绍

慕侠1099496

2020-02-07 15:41:33

mysql> CREATE TABLE IF NOT EXISTS imooc_user(id INT,username VARCHAR(20),password CHAR(32),email VARCHAR(50),age TINYINT,card CHAR(18),tel CHAR(11),salary FLOAT(8,2),married TINYINT(1),addr VARCHAR(100),sex ENUM('男','女','保密'))ENGINE=INNODB CHARSET=UTF8;
Query OK, 0 rows affected, 3 warnings (0.02 sec)

mysql> SHOW WARNINGS;
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                                                                                     |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Warning | 1681 | Specifying number of digits for floating point data types is deprecated and will be removed in a future release.                                                            |
| Warning | 1681 | Integer display width is deprecated and will be removed in a future release.                                                                                                |
| Warning | 3719 | 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous. |
+---------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

mysql>

写回答

1回答

好帮手慕小班

2020-02-07

同学你好,运行贴出sql语句,并没有问题,这里只是警告信息,比如:Integer display width is deprecated and will be removed in a future release--->不赞成int类型的整数有长度,并在以后的版本中删除这个内容。

同学现在可以不用关注这个警告信息。

如果我的回答解决了你的疑惑,请采纳!祝学习愉快!

1

0 学习 · 8016 问题

查看课程