re: Duplicate key error
Graham, Sunday, September 22, 2002, 3:15:23 PM, you wrote: GH I am aware that this is an error of my own making, however . . . GH I am unable to install my sql because the scipt fails with GH a duplicate key error GH Preparing db table GH Preparing host table GH Preparing user table GH Preparing func table GH Preparing tables_priv table GH Preparing columns_priv table GH Installing all prepared tables GH ERROR: 1062 Duplicate entry 'localhost-root' for key 1 GH ERROR: 1062 Duplicate entry 'localhost-root' for key 1 GH 020922 12:55:57 ./bin/mysqld: Shutdown Complete GH I have removed the database to the best of my ability, and am unable to find GH any mysql files of anything containing the text localhost-root. The GH output however remains the same. GH I have a mac G4 with os 10.1.5 GH Can anyone advise me how to proceed? What version of MySQL did you installed? Did you edit mysql_install_db script? -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ __ / |/ /_ __/ __/ __ \/ /Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net ___/ www.mysql.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: duplicate key error on autoincrement field while inserting
What operating system are you running, and how big are these files and indicies? Is this a 2 Gig file size limit problem? You are getting near the limit to the size of an unsigned mediumint. Dan Shapella wrote: I have a weird one here. I have an application that inserts records into one of 2 different tables. The other day, an insert attempt on one of the tables failed with a duplicate key error on key 1, an autoincrement field. About a minute later, an insert attempt on the other table failed similarly. But, when a SELECT was done on each table for the key value in question, no record was found. The autoincrement values in question were 16288908 for the first table, and 11339940 for the second table. These tables handle thousands of inserts per day, and all other table activity is read-only via SELECT statements. Does anyone have any idea what may have caused this and what can be done to prevent it? It is as if MySQL built the record with key value 16288908, placed it in the table cache, built another record with the same key, tried to place that in the table cache and failed, reported the error, and then deleted the record from the table cache before it was written into the actual table. I did a myisamchk -i on the first table, which generated the following: Checking MyISAM file: attempt.MYI Data records: 16288907 Deleted blocks: 0 /usr/local/bin/myisamchk: warning: Table is marked as crashed /usr/local/bin/myisamchk: warning: 1 clients is using or hasn't closed the table properly - check file-size - check key delete-chain - check record delete-chain - check index reference - check data record references index: 1 /usr/local/bin/myisamchk: error: Found key at page 280732672 that points to record outside datafile - check record links /usr/local/bin/myisamchk: error: Checksum for key: 1 doesn't match checksum for records /usr/local/bin/myisamchk: error: Checksum for key: 2 doesn't match checksum for records Record blocks:16288907Delete blocks: 0 Record data:1829202488Deleted data: 0 Lost space: 12006835Linkdata: 61081997 MyISAM-table 'attempt.MYI' is corrupted Fix it using switch -r or -o Any suggestions would be greatly appreciated. Thanks! _ Get your FREE download of MSN Explorer at http://explorer.msn.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: duplicate key error on autoincrement field while inserting
OS Is Linux. The autoincrement key is defined as INT, so plenty of room there. Table sizes are getting up there: attempt.MYD 1,902,291,232inrec.MYD 1,979,795,600 attempt.MYI 280,733,696inrec.MYI 240,460,800 After doing a myisamchk -r on the attempt table, inserts appear to be working again, so I would't think the huge file sizes are the problem (yet). No recovery was done on the inrec table, but after doing a FLUSH-TABLE, an insert worked on that table as well. Don't understand that one. I still point back to the fact that 2 different tables had autoincrement problems at virtually the same time. And this is the only app running on this system. Why did MySql decide these 2 keys already exist when in fact they don't? From: Gerald Clark [EMAIL PROTECTED] To: Dan Shapella [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: duplicate key error on autoincrement field while inserting Date: Tue, 24 Apr 2001 13:08:47 -0500 What operating system are you running, and how big are these files and indicies? Is this a 2 Gig file size limit problem? You are getting near the limit to the size of an unsigned mediumint. Dan Shapella wrote: I have a weird one here. I have an application that inserts records into one of 2 different tables. The other day, an insert attempt on one of the tables failed with a duplicate key error on key 1, an autoincrement field. About a minute later, an insert attempt on the other table failed similarly. But, when a SELECT was done on each table for the key value in question, no record was found. The autoincrement values in question were 16288908 for the first table, and 11339940 for the second table. These tables handle thousands of inserts per day, and all other table activity is read-only via SELECT statements. Does anyone have any idea what may have caused this and what can be done to prevent it? It is as if MySQL built the record with key value 16288908, placed it in the table cache, built another record with the same key, tried to place that in the table cache and failed, reported the error, and then deleted the record from the table cache before it was written into the actual table. I did a myisamchk -i on the first table, which generated the following: Checking MyISAM file: attempt.MYI Data records: 16288907 Deleted blocks: 0 /usr/local/bin/myisamchk: warning: Table is marked as crashed /usr/local/bin/myisamchk: warning: 1 clients is using or hasn't closed the table properly - check file-size - check key delete-chain - check record delete-chain - check index reference - check data record references index: 1 /usr/local/bin/myisamchk: error: Found key at page 280732672 that points to record outside datafile - check record links /usr/local/bin/myisamchk: error: Checksum for key: 1 doesn't match checksum for records /usr/local/bin/myisamchk: error: Checksum for key: 2 doesn't match checksum for records Record blocks:16288907Delete blocks: 0 Record data:1829202488Deleted data: 0 Lost space: 12006835Linkdata: 61081997 MyISAM-table 'attempt.MYI' is corrupted Fix it using switch -r or -o Any suggestions would be greatly appreciated. Thanks! _ Get your FREE download of MSN Explorer at http://explorer.msn.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php _ Get your FREE download of MSN Explorer at http://explorer.msn.com - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php