zoukankan      html  css  js  c++  java
  • mysql AUTO_INCREMENT

    mysql> CREATE TABLE test
        -> (
        -> id INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
        -> username VARCHAR(15) NOT NULL
        -> )AUTO_INCREMENT = 100;
    Query OK, 0 rows affected (0.07 sec)
    
    mysql> show create table testG;
    *************************** 1. row ***************************
           Table: test
    Create Table: CREATE TABLE `test` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `username` varchar(15) NOT NULL,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8
    1 row in set (0.00 sec)
    
    ERROR: 
    No query specified
    
    mysql> insert into test(username) values('aaa');
    Query OK, 1 row affected (0.01 sec)
    
    mysql> select * from test;
    +-----+----------+
    | id  | username |
    +-----+----------+
    | 100 | aaa      |
    +-----+----------+
    1 row in set (0.00 sec)
    
    mysql>  insert into test(username) values('bbb');
    Query OK, 1 row affected (0.01 sec)
    
    mysql> select * from test;
    +-----+----------+
    | id  | username |
    +-----+----------+
    | 100 | aaa      |
    | 101 | bbb      |
    +-----+----------+
    2 rows in set (0.00 sec)

  • 相关阅读:
    02.CentOS Linux 7.7 Nginx安装部署文档
    rpm操作
    mysql命令行备份方法
    nginx reload的原理
    Linux操作笔记
    mysql账户授权
    centos系统内核升级
    docker随笔
    linux系统查看当前正在运行的服务
    数据库锁表问题
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13351250.html
Copyright © 2011-2022 走看看