Home  >  Article  >  Database  >  Mysql, how to set the primary key to increase automatically in navicat

Mysql, how to set the primary key to increase automatically in navicat

angryTom
angryTomOriginal
2019-08-15 14:05:568339browse

Mysql, how to set the primary key to increase automatically in navicat

Navicat is a view management tool for mysql that is widely used. Below is a record of how Navicat sets the primary key to auto-increment.

Recommended tutorial: MySQL introductory video tutorial

##1. Find the table that needs to be operated, right-click and find the design table

2. Find the corresponding field, change it to int type, and there will be an automatic increment check box below, just check it (note that the data type must be int type)

Mysql, how to set the primary key to increase automatically in navicat

Extended information

 

The primary key (primary key) is one or more fields in the table, and its value is expressed in To uniquely identify a record in the table. In a relationship between two tables, the primary key is used in one table to reference a specific record from the other table. The primary key is a unique key that is part of the table definition. The primary key of a table can be composed of multiple keywords, and the columns of the primary key cannot contain null values. Primary keywords are optional and can be defined in a CREATE TABLE or ALTER TABLE statement.

Its functions include

 1) Ensure the integrity of entities;

 2) Speed ​​up the operation of the database;

 3 ) When adding a new record to the table, ACCESS will automatically check the primary key value of the new record and do not allow this value to be repeated with the primary key value of other records;

 4) ACCESS automatically displays the primary key value in the order records in the table. If no primary key is defined, the records in the table are displayed in the order in which they were entered.

The above is the detailed content of Mysql, how to set the primary key to increase automatically in navicat. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn