• Rejestracja
vBHELP.pl - polskie wsparcie vBulletin
  1. #1
    Awatar Max
    Max
    Max jest nieaktywny There's something in the Air ...
    Dołączył
    Jan 2008
    Posty
    4 775
    Przydatne posty
    252
    Wpisów
    13

    Domyślnie Duplicate entry 'X'

    Zdarza się podczas importowania bazy, że otrzymujemy taki błąd:
    MySQL Error : Duplicate entry 'XXX' for key 1

    Najczęściej błąd powodują modyfikacje w bazie. Usuń wszystkie i spróbuj ponownie.

    Przyczyną może być również problem ze zgodnością wersji MySQL. Wtedy też baza nie potrafi się dostosować. Aby to poprawić wyślij poniższe zapytania do bazy:

    Kod:
    ALTER TABLE `adminhelp` CHANGE `adminhelpid` `adminhelpid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `adminlog` CHANGE `adminlogid` `adminlogid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `adminmessage` CHANGE `adminmessageid` `adminmessageid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `announcement` CHANGE `announcementid` `announcementid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `attachment` CHANGE `attachmentid` `attachmentid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `attachmentpermission` CHANGE `attachmentpermissionid` `attachmentpermissionid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `avatar` CHANGE `avatarid` `avatarid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `bbcode` CHANGE `bbcodeid` `bbcodeid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `calendar` CHANGE `calendarid` `calendarid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `calendarcustomfield` CHANGE `calendarcustomfieldid` `calendarcustomfieldid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `calendarmoderator` CHANGE `calendarmoderatorid` `calendarmoderatorid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `calendarpermission` CHANGE `calendarpermissionid` `calendarpermissionid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `cron` CHANGE `cronid` `cronid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `cronlog` CHANGE `cronlogid` `cronlogid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `event` CHANGE `eventid` `eventid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `forum` CHANGE `forumid` `forumid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `forumpermission` CHANGE `forumpermissionid` `forumpermissionid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `holiday` CHANGE `holidayid` `holidayid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `icon` CHANGE `iconid` `iconid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `infraction` CHANGE `infractionid` `infractionid` INT ( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `infractionban` CHANGE `infractionbanid` `infractionbanid` INT ( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `infractiongroup` CHANGE `infractiongroupid` `infractiongroupid` INT ( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `infractionlevel` CHANGE `infractionlevelid` `infractionlevelid` INT ( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `imagecategory` CHANGE `imagecategoryid` `imagecategoryid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `language` CHANGE `languageid` `languageid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `mailqueue` CHANGE `mailqueueid` `mailqueueid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `moderator` CHANGE `moderatorid` `moderatorid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `moderatorlog` CHANGE `moderatorlogid` `moderatorlogid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `paymentapi` CHANGE `paymentapiid` `paymentapiid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `paymentinfo` CHANGE `paymentinfoid` `paymentinfoid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `paymenttransaction` CHANGE `paymenttransactionid` `paymenttransactionid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `phrase` CHANGE `phraseid` `phraseid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `plugin` CHANGE `pluginid` `pluginid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `pm` CHANGE `pmid` `pmid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `pmtext` CHANGE `pmtextid` `pmtextid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `poll` CHANGE `pollid` `pollid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `pollvote` CHANGE `pollvoteid` `pollvoteid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `post` CHANGE `postid` `postid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `productcode` CHANGE `productcodeid` `productcodeid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `productdependency` CHANGE `productdependencyid` `productdependencyid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `profilefield` CHANGE `profilefieldid` `profilefieldid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `ranks` CHANGE `rankid` `rankid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `reminder` CHANGE `reminderid` `reminderid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `reputation` CHANGE `reputationid` `reputationid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `reputationlevel` CHANGE `reputationlevelid` `reputationlevelid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `rssfeed` CHANGE `rssfeedid` `rssfeedid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `search` CHANGE `searchid` `searchid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `smilie` CHANGE `smilieid` `smilieid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `style` CHANGE `styleid` `styleid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `subscribeevent` CHANGE `subscribeeventid` `subscribeeventid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `subscribeforum` CHANGE `subscribeforumid` `subscribeforumid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `subscribethread` CHANGE `subscribethreadid` `subscribethreadid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `subscription` CHANGE `subscriptionid` `subscriptionid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `subscriptionlog` CHANGE `subscriptionlogid` `subscriptionlogid` MEDIUMINT( 8 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `subscriptionpermission` CHANGE `subscriptionpermissionid` `subscriptionpermissionid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `template` CHANGE `templateid` `templateid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `templatehistory` CHANGE `templatehistoryid` `templatehistoryid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `thread` CHANGE `threadid` `threadid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `threadrate` CHANGE `threadrateid` `threadrateid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `upgradelog` CHANGE `upgradelogid` `upgradelogid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `user` CHANGE `userid` `userid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `useractivation` CHANGE `useractivationid` `useractivationid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `userchangelog` CHANGE `changeid` `changeid` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `usergroup` CHANGE `usergroupid` `usergroupid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `usergroupleader` CHANGE `usergroupleaderid` `usergroupleaderid` SMALLINT( 5 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `usergrouprequest` CHANGE `usergrouprequestid` `usergrouprequestid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `usernote` CHANGE `usernoteid` `usernoteid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `usertitle` CHANGE `usertitleid` `usertitleid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `userpromotion` CHANGE `userpromotionid` `userpromotionid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;
    ALTER TABLE `word` CHANGE `wordid` `wordid` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT;



  2. #2
    Awatar falon
    falon jest nieaktywny Advanced Member
    Dołączył
    Jul 2008
    Posty
    911
    Przydatne posty
    3

    Domyślnie

    miałem to i pomogło usunięcie z bazy treści odpowiedzialnej za wyszukiwarkę, czyli indeksu wyszukiwarki.
    Najlepiej usunąć zanim się zgra bazę.


  3. #3
    Seba jest nieaktywny Advanced Member
    Dołączył
    Feb 2009
    Posty
    1 059
    Przydatne posty
    44

    Domyślnie

    Zależy czym się wgrywa. Jeżeli posiada się ssh, to za pomocą mysql pomoże parametr -f [--force], natomiast przy pomocy mysqlimport --replace oraz ew. --ignore.
    Profesjonalne modyfikacje vBulletin oraz style - gg 1981480 badz PW


  4. #4
    Awatar day-dreamer
    day-dreamer jest nieaktywny Użytkownik vBHELP.pl
    Dołączył
    Feb 2008
    Posty
    723
    Przydatne posty
    3

    Domyślnie

    Seba a mógłbyś ułożyć komendę z parametrem -f [--force]?

    bo ja wgrywam bazę z wymuszonym kodowaniem

    mysql -u root -p --default-character-set=latin2 baza < baza.sql

    ale wywala mi Duplicate entry

    i chciałbym gotowe zapytanie z wymuszonym kodowaniem i z parametrem -f [--force]


  5. #5
    Seba jest nieaktywny Advanced Member
    Dołączył
    Feb 2009
    Posty
    1 059
    Przydatne posty
    44

    Domyślnie

    mysql -f reszta

    :]

    PS. Polecam mysqlimport zainstalować, wchodzi to w skład pakietu mysql-client.
    Profesjonalne modyfikacje vBulletin oraz style - gg 1981480 badz PW


Chmurka.pl

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67