xxxxxxxxxx
ALTER TABLE document MODIFY COLUMN document_id INT auto_increment
xxxxxxxxxx
Copied
CREATE TABLE animals (
id MEDIUMINT NOT NULL AUTO_INCREMENT,
name CHAR(30) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO animals (name) VALUES
('dog'),('cat'),('penguin'),
('lax'),('whale'),('ostrich');
SELECT * FROM animals;
xxxxxxxxxx
ALTER TABLE `table_name` ADD COLUMN `id` INT AUTO_INCREMENT UNIQUE FIRST;
xxxxxxxxxx
ALTER TABLE tbl_access ADD COLUMN `access_id` int(10) NOT NULL PRIMARY KEY AUTO_INCREMENT FIRST
xxxxxxxxxx
CREATE TABLE IF NOT EXISTS blog_users (
id INT NOT NULL AUTO_INCREMENT,
email VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
)