473,387 Members | 1,440 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

alter table 'table' auto_increment = # doesn't work

i cannot set auto_increment to start from anything other than 1:

mysql> create table test (id int unsigned not null auto_increment primary key);

mysql> alter table test auto_increment=2;

mysql> insert into test() values();

mysql> select * from test;
+----+
| id |
+----+
| 1 |
+----+
1 row in set (0.00 sec)
please help,
ittay
Jul 19 '05 #1
2 14317
try

mysql> alter table test SET auto_increment=2;
"Ittay Freiman" <it***@qlusters.com> wrote in message
news:1a*************************@posting.google.co m...
i cannot set auto_increment to start from anything other than 1:

mysql> create table test (id int unsigned not null auto_increment primary key);
mysql> alter table test auto_increment=2;

mysql> insert into test() values();

mysql> select * from test;
+----+
| id |
+----+
| 1 |
+----+
1 row in set (0.00 sec)
please help,
ittay

Jul 19 '05 #2
try

mysql> alter table test SET auto_increment=2;
"Ittay Freiman" <it***@qlusters.com> wrote in message
news:1a*************************@posting.google.co m...
i cannot set auto_increment to start from anything other than 1:

mysql> create table test (id int unsigned not null auto_increment primary key);
mysql> alter table test auto_increment=2;

mysql> insert into test() values();

mysql> select * from test;
+----+
| id |
+----+
| 1 |
+----+
1 row in set (0.00 sec)
please help,
ittay

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andrew | last post by:
I have a problem creating mySQL tables with PHP. I am making an app where a user can create a project. Pressing "submit" on proj_form.php goes to proj_add.php where a couple of things happen. ...
2
by: Dylan Nicholson | last post by:
Seems that Oracle 9.2 (using MS ODBC driver) requires extra parentheses when adding multiple columns to a table: ALTER TABLE MyTable ADD (MyColumn1 VARCHAR(255), MyColumn2 VARCHAR(255)) vs ...
6
by: E | last post by:
I have two tables and i want join the two of the primary id's in to one table. the database is mysql. ex. Table Item (ID int(10) NOT NULL auto_increment) Table Actor(ID int(10) NOT NULL...
1
by: Lannsjo | last post by:
I need to change my primary key column type from smallint to int. I have tried: ALTER TABLE livegroup MODIFY id INT UNSIGNED NOT NULL AUTO_INCREMENT; But get an error message certainly since my...
2
by: leegold2 | last post by:
mysql> describe keywords; +-------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra |...
6
by: Brian Basquille | last post by:
Just started learning SQL recently. But one thing i'm still not clear on is about altering relationships between tables after they've been created. Instead of creating a foreign key when the...
0
by: anzenews | last post by:
Hello! I have a weird problem... The application I use issues this SQL from time to time: alter table t modify id int(6) unique not null auto_increment; The problem is that this SQL adds a...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
0
by: thefredzx | last post by:
i have a problem for aplication of apriori algorithm in datamining..my problem is how to make an additional field in database? for example: I have some data like shown below:...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.