Questions tagged [autoincrement]

10 questions
16
votes
6 answers

MySQL Auto-increment fields resets by itself

We have a MySQL table that has an auto-incrementing field set as an INT (11). This table pretty much stores a list of jobs that are running in an application. At any given moment during the lifetime of the application, the table could well contain…
Hooligancat
  • 263
  • 1
  • 2
  • 6
6
votes
2 answers

How to force MySQL to take 0 as a valid auto-increment value

Long story short, I have a SQL file that I want to import as a skel style file, so this will be done repeatedly, programmatically. I can edit the SQL file however I want, but I'd rather not touch the application itself. This application uses userid…
Matthew Scharley
  • 1,467
  • 2
  • 14
  • 19
2
votes
1 answer

How to scale out by elvolving from database partitions to sharding?

Say I have a MySQL table: CREATE TABLE tweets ( tweet_id INT NOT NULL AUTO_INCREMENT, author_id INT NOT NULL, text CHAR(140) NOT NULL, PRIMARY KEY (tweet_id) ) PARTITION BY HASH(tweet_id) PARTITIONS 12; All is good. The table lives on a single…
Continuation
  • 3,050
  • 5
  • 29
  • 38
1
vote
4 answers

MySQL Auto Increment failing

I am having a table with one column of primary key and auto increment of int(11) data type. When I am trying to insert into that table, I am getting following error. Failed to read auto-increment value from storage engine Query When I restart MySQL…
Phanindra
  • 203
  • 1
  • 4
  • 11
1
vote
1 answer

How to create a table in MySQL with automatic numeration of rows?

I just want to have a table in which a first column is a monotonically increasing unique integer number. For example, if I have a table with 5 rows the indexes of the rows should be 1,2,3,4,5. And if I add a new row it gets index 6. I am alway…
Roman
  • 2,439
  • 9
  • 32
  • 32
0
votes
1 answer

Bash script, read from file, increment variable and output to other file

I have a Debian server with many VLANs. All of that vlan started from 1. I need to read from file all IP, and output all of this in other file. All ok, but i have a problem with increment variable. if [ -f /root/ip ]; then for IP_ADD in `grep -v…
0
votes
1 answer

MariaDB auto-increment-increment having no effect

I am trying to set up a master-master MySQL replication (both active servers). As I'm doing this on Centos 7, I have to use MariaDB instead of MySQL, although it seems fairly similar. So, before I set up the replication, I am trying to set…
0
votes
1 answer

Microsoft Access Duplicates Auto Incremented MySQL Record When Info Identical

I've recently run into one of the most frustrating bugs I've seen with a Microsoft Access integration with MySQL. What happens is that if you type something in a record, and then quickly move to the next record and type the exact same thing, the…
0
votes
1 answer

mysql tables strange behaviour

i have a wordpress driven web site. i am having a very very weird issue. i am clean installing my wordpress, using it about a week or so then i am losing admin rights in wp-admin. i can login with my admin account, i can confirm that its role is…
borannb
  • 1
  • 1
  • 5
0
votes
3 answers

MYSQL Table Reset Auto Increment to 1, while retaining existing records with ids

I have a MySQL table naming Product for a classified site, product_id is bigint(20) AUTO_INCREMENT field. Currently AUTO_INCREMENT value is 224143. Client want it to restart from 1. but this table has 7000 existing STARTING from prduct_id 210235 to…