PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Logiciels d'hébergement > mailing.database.mysql > InnoDB + AUTO_INCREMENT questions.
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
InnoDB + AUTO_INCREMENT questions.

Réponse
 
LinkBack Outils de la discussion
Vieux 25/04/2006, 10h04   #1
Phil Latio
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut InnoDB + AUTO_INCREMENT questions.

Newbie questions here...

Reading the MySQL manual regarding InnoDB databases, can someone confirm
that:
1. if the server is rebooted, AUTO_INCREMENT reverts back to 1?
2. what happens if the field is specified as or PRIMARY KEY or UNIQUE?

Cheers

Phil



  Réponse avec citation
Vieux 25/04/2006, 18h21   #2
Bill Karwin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: InnoDB + AUTO_INCREMENT questions.

Phil Latio wrote:
> Newbie questions here...
>
> Reading the MySQL manual regarding InnoDB databases, can someone confirm
> that:
> 1. if the server is rebooted, AUTO_INCREMENT reverts back to 1?


False. The next row inserted into a table with an AUTO_INCREMENT column
generates a new value, the next in the sequence higher than the last
value that was generated for that column. Note that this could leave
gaps, if you have deleted rows in the meantime.

The database remembers which value was last generated per table, even
after a reboot.

> 2. what happens if the field is specified as or PRIMARY KEY or UNIQUE?


No difference.

Note that AUTO_INCREMENT can be declared only for an indexed integer
column, of which columns with PRIMARY KEY or UNIQUE constraints are
examples.

Regards,
Bill K.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h17.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,06559 seconds with 10 queries