0

I am using MariaDB 5.5, and created table schema as below:

CREATE TABLE `tasks` (
  `taskid` bigint(20) NOT NULL auto_increment,
  `status` bigint(20) NOT NULL default 0,
PRIMARY KEY  (`taskid`),
  KEY `status` (`status`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
SET character_set_client = @saved_cs_client;

I want to start my taskid from 10 by default(As configured AUTO_INCREMENT=10), however if I insert any row, it is starting from 1. Do I need to perform any other configuration ?

This is working for me if engine type is MyISAM. And I am not trying to reset the counter, I am trying to start it from 10 only.

Apoorv Gupta
  • 399
  • 1
  • 4
  • 16
  • have you inserted [**this way**](http://sqlfiddle.com/#!9/287d0/1/0)? – 1000111 Oct 06 '16 at 07:00
  • Yes, I am doing insert this way only. Also, it is working for me in MyISAM but not working in InnoDB. – Apoorv Gupta Oct 06 '16 at 07:07
  • How is it Duplicate ? I am trying to reset counter. I am trying to create schema such that first insert will start from 10 only. – Apoorv Gupta Oct 06 '16 at 07:07
  • 1
    It works for me in 5.5.52. I did `CREATE TABLE` (pasted from your question); `insert into tasks (status) values (111);` (Query OK, 1 row affected (0.03 sec)); `select * from tasks;` -- got `10, 111`. – Rick James Oct 07 '16 at 01:43

0 Answers0