In MySQL, use the AUTO_INCRMENT keyword, and the column must be defined as a primary key (PRIMARY KEY) or have a unique index (UNIQUE index).
like this
CREATE TABLE users (
id INT NOT NULL AUTO_INCREMENT,
username VARCHAR(50) NOT NULL,
email VARCHAR(100),
PRIMARY KEY (id)
);