简单问题,自动编号当达到最大值后再增加会怎么样 自动编号当达到最大值后再增加会怎么样,自动编号使用整形(mysql数据库) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 很简单,自己做个试验就知道了。mysql> create table jeff0002(id TINYINT primary key auto_increment,col1 int);Query OK, 0 rows affected (0.08 sec)mysql> select * from jeff0002;Empty set (0.00 sec)mysql> insert into jeff0002 values (125,125);Query OK, 1 row affected (0.05 sec)mysql> select * from jeff0002;+-----+------+| id | col1 |+-----+------+| 125 | 125 |+-----+------+1 row in set (0.00 sec)mysql> insert into jeff0002(col1) values (126);Query OK, 1 row affected (0.05 sec)mysql> select * from jeff0002;+-----+------+| id | col1 |+-----+------+| 125 | 125 || 126 | 126 |+-----+------+2 rows in set (0.00 sec)mysql> insert into jeff0002(col1) values (127);Query OK, 1 row affected (0.03 sec)mysql> select * from jeff0002;+-----+------+| id | col1 |+-----+------+| 125 | 125 || 126 | 126 || 127 | 127 |+-----+------+3 rows in set (0.00 sec)mysql> insert into jeff0002(col1) values (128);ERROR 1062 (23000): Duplicate entry '127' for key 'PRIMARY'mysql> select * from jeff0002;+-----+------+| id | col1 |+-----+------+| 125 | 125 || 126 | 126 || 127 | 127 |+-----+------+3 rows in set (0.00 sec)mysql> 试验结果表明,会报 ERROR 1062 (23000): Duplicate entry '127' for key 'PRIMARY' 错误。 最好设大一点,int 10 。 sql语句应该如何写? mysql 密码正确,程序运行一段时间后就提示密码不对,重启就好了 MY SQL这个问题怎么解决 程序连接成功,用mysqlcc连接管理却出错,望解,谢谢 问一个mysql_front的连接问题 后缀名为mysql(*.mysql)文件在mysql中如何使用? mysql备份问题 我的MySQL为何不能创建数据库和表? 如何进行字符串连接? mysql执行计划key_len长度 求一个Mysql存储过程语句 (救急)mysql连接报错:ERROR 2013 (HY000): Lost connection to MySQL server during query
Query OK, 0 rows affected (0.08 sec)mysql> select * from jeff0002;
Empty set (0.00 sec)mysql> insert into jeff0002 values (125,125);
Query OK, 1 row affected (0.05 sec)mysql> select * from jeff0002;
+-----+------+
| id | col1 |
+-----+------+
| 125 | 125 |
+-----+------+
1 row in set (0.00 sec)mysql> insert into jeff0002(col1) values (126);
Query OK, 1 row affected (0.05 sec)mysql> select * from jeff0002;
+-----+------+
| id | col1 |
+-----+------+
| 125 | 125 |
| 126 | 126 |
+-----+------+
2 rows in set (0.00 sec)mysql> insert into jeff0002(col1) values (127);
Query OK, 1 row affected (0.03 sec)mysql> select * from jeff0002;
+-----+------+
| id | col1 |
+-----+------+
| 125 | 125 |
| 126 | 126 |
| 127 | 127 |
+-----+------+
3 rows in set (0.00 sec)mysql> insert into jeff0002(col1) values (128);
ERROR 1062 (23000): Duplicate entry '127' for key 'PRIMARY'
mysql> select * from jeff0002;
+-----+------+
| id | col1 |
+-----+------+
| 125 | 125 |
| 126 | 126 |
| 127 | 127 |
+-----+------+
3 rows in set (0.00 sec)mysql>