[drupal-support] Upgrading database from 4.5.4 to 4.6.2 (was Psychophobia)

Gerhard Killesreiter killesreiter at physik.uni-freiburg.de
Wed Jul 20 22:56:50 UTC 2005



On Wed, 20 Jul 2005 sunblockster at gmail.com wrote:

> > 2005-03-21
> >
> > user error: Duplicate entry '0-11' for key 1
> > query: ALTER TABLE term_node ADD PRIMARY KEY (tid,nid) in /path/to/
> > file/www/drupal462/includes/database.mysql.inc on line 66.
> >
> > ALTER TABLE {term_node} ADD PRIMARY KEY (tid,nid)
> > FAILED

This has happened today to me as well. What I did is:

mysqldump  -uuser -ppass db term_node -w 'tid = 0'| sort | uniq > term_node.sql

then I deleted the entries where tid = 0 and re-imported term_node.sql
after deleting the table structure on top of the file.

Afterwards add the index:

ALTER TABLE term_node ADD PRIMARY KEY (tid,nid);

> Any ideas why this failed, and how to fix it?

For some reason, there are duplicates of (tid, nid) = (0, 11) in the
database. Probably many more.

No idea why.

Cheers,
	Gerhard



More information about the drupal-support mailing list