• MYSQL基础管理-auto_increment测试应用


    mysql> create table tid (id int not null auto_increment,name varchar(100) ,prima
    ry key(id));
    Query OK, 0 rows affected (0.11 sec)

    mysql>
    mysql>
    mysql> insert into tid values('123');
    ERROR 1136 (21S01): Column count doesn't match value count at row 1
    mysql> insert into tid(name) values('123');
    Query OK, 1 row affected (0.02 sec)

    mysql> commit;
    Query OK, 0 rows affected (0.00 sec)

    mysql> select * from tid;
    +----+------+
    | id | name |
    +----+------+
    |  1 | 123  |
    +----+------+
    1 row in set (0.01 sec)

    mysql> insert into tid(name) values('1111');
    Query OK, 1 row affected (0.01 sec)

    mysql> insert into tid(name) values('1111');
    Query OK, 1 row affected (0.02 sec)

    mysql> insert into tid(name) values('1111');
    Query OK, 1 row affected (0.01 sec)

    mysql> insert into tid(name) values('1111');
    Query OK, 1 row affected (0.01 sec)

    mysql> insert into tid(name) values('1111');
    Query OK, 1 row affected (0.01 sec)

    mysql> insert into tid(name) values('1111');
    Query OK, 1 row affected (0.01 sec)

    mysql> insert into tid(name) values('1111');
    Query OK, 1 row affected (0.01 sec)

    mysql> insert into tid(name) values('1111');
    Query OK, 1 row affected (0.02 sec)

    mysql> select * from tid;
    +----+------+
    | id | name |
    +----+------+
    |  1 | 123  |
    |  2 | 1111 |
    |  3 | 1111 |
    |  4 | 1111 |
    |  5 | 1111 |
    |  6 | 1111 |
    |  7 | 1111 |
    |  8 | 1111 |
    |  9 | 1111 |
    +----+------+
    9 rows in set (0.00 sec)

    mysql> show create table tid\G
    *************************** 1. row ***************************
           Table: tid
    Create Table: CREATE TABLE `tid` (
      `id` int NOT NULL AUTO_INCREMENT,
      `name` varchar(100) DEFAULT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_a
    i_ci
    1 row in set (0.01 sec)

    mysql>
     

  • 相关阅读:
    nvm 安装 node.js,可切换版本
    Linux 文件/目录访问(opendir/closedir/readdir)
    springboot单独在指定地方输出sql
    2022 icpc杭州站 C. No Bug No Game - 背包dp
    2022icpc沈阳站感想
    EPSon打印机更换色带
    Restful API 设计示例
    Google Swift 与 DC 传输
    nginx-编译安装-基础指令-信号
    软件测试概念篇
  • 原文地址:https://blog.csdn.net/oradbm/article/details/132854152