Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How i can change the AUTO INCREMENT ?

Posted on 2011-02-22
6
Medium Priority
?
596 Views
Last Modified: 2013-11-08
Hello there, i have already table "videos" with many rows 800000+, how i can setup auto_increment to start from 1000000 not to continuie from 800000+, some sql commands ?
0
Comment
Question by:DjZoC
6 Comments
 
LVL 7

Expert Comment

by:MrNed
ID: 34958468
In PostgreSQL you can use:

ALTER SEQUENCE SEQ_NAME RESTART WITH 1000000;
0
 
LVL 7

Assisted Solution

by:MrNed
MrNed earned 1000 total points
ID: 34958476
In MySQL you can try this: http://www.tutorialspoint.com/mysql/mysql-using-sequences.htm

You should state which database you're using, btw :)
0
 
LVL 11

Expert Comment

by:mattibutt
ID: 34959366
If you got phpmyadmin you can put the value you desire and hopefully it will after that based on the largest value+1
If you edit the column iu believe I will let you know how to do it step by step if required
0
 
LVL 1

Accepted Solution

by:
merjasec earned 1000 total points
ID: 35211108
Try this SQL:

ALTER TABLE videos AUTO_INCREMENT = 1000000;

Open in new window

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 37307704
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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 series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
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

972 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