Mysql primary key auto-increment and default value, mysql Default Value

Source: Internet
Author: User

Mysql primary key auto-increment and default value, mysql Default Value

Create table 'ecm _ address' ('addr _ id' int (10) unsigned not null AUTO_INCREMENT, 'user _ id' int (10) unsigned not null default '0 ', 'consignee' varchar (60) not null default '', 'region _ id' int (10) unsigned default null, 'region _ name' varchar (255) default null, 'address' varchar (255) default null, 'zipcode' varchar (20) default null, 'phone _ tel 'varchar (60) default null, 'Phone _ mob' varchar (60) DEFAULT NULL, primary key ('addr _ id'), KEY 'user _ id' ('user _ id ')) ENGINE = MyISAM AUTO_INCREMENT = 2 default charset = utf8 pay attention to the mysql statement used to create the table. In the last row, there is AUTO_INCREMENT = 2, which indicates that after the table is created, automatic growth starts from 2. If it is equal to 10, it starts from 10. Thank you!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.