Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Specifying auto number seed and step values in MySql when using the Create Table command

Posted on 2006-11-18
3
Medium Priority
?
772 Views
Last Modified: 2012-06-22
How can you specify the seed and step values when creating an autonumber using the create table command?

Thanks

Fred
0
Comment
Question by:fred2k3
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 375 total points
ID: 17972650
http://dev.mysql.com/doc/refman/5.0/en/create-table.html

you can only specify a starting value (seed), mysql does not support step values different from 1:
create table yourtable ( auto_field  INT AUTO_INCREMENT , .... ) AUTO_INCREMENT = 2

0
 
LVL 30

Expert Comment

by:todd_farmer
ID: 17972779
You actually can control this behavior - but not at the CREATE TABLE level.  You can set server parameters (auto_increment_increment and auto_increment_offset) that control this:

http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html

Obviously, this impacts all tables.

Hope that helps.
0
 

Author Comment

by:fred2k3
ID: 17982369
cheers guys
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
In this article, we’ll look at how to deploy ProxySQL.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question