473,287 Members | 1,582 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,287 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 14308
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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.