Support » Installing WordPress » WordPress database errors during 2.0 upgrade

  • Resolved bchen


    I’m attempting an upgrade from wp 1.5.2, and when I run upgrade.php and go to step 1, I get some database errors that look like this:

    WordPress database error: [Invalid default value for ‘comment_approved’]
    ALTER TABLE em_comments CHANGE COLUMN user_id user_id bigint(20) NOT NULL default ‘0’

    WordPress database error: [Invalid default value for ‘auto_toggle’]
    ALTER TABLE em_linkcategories CHANGE COLUMN show_images show_images enum(‘Y’,’N’) NOT NULL default ‘Y’

    WordPress database error: [Invalid default value for ‘auto_toggle’]
    ALTER TABLE em_linkcategories ALTER COLUMN show_images SET DEFAULT ‘Y’

    This isn’t normal, is it? Any ideas?

    After these errors, I continued on to the admin pages for my site, and it looks like things are more or less working, though I haven’t really probed things.

    One thing I did notice is that the formatting is all messed up in Firefox, but not IE. Is this intentional? The expandable boxes are in the wrong places on the page and overlaps other text on the page.

Viewing 7 replies - 1 through 7 (of 7 total)
  • skippy



    I’m not sure what would cause the database error. Maybe try re-uploading the files, taking care to use ASCII mode for the transfer; then run upgrade.php again?

    The second problem (Firefox formatting) has not happened to me. Maybe try a hard refresh (CTRL+F5 or CTRL+R)?

    I’m attempting this upgrade on my local machine first before I do it at my hosting provider, so it’s not a problem with ASCII mode transfers. I’m just copying the files from the extracted zip file to the folder where I have a local copy of my site.

    When I look at the column “auto_toggle” on em_linkcategories, it is of type enum(‘Y’,’N’), but I don’t see a default for it. I tried setting the default to ‘Y’ by editing the field in phpmyadmin, but it doesn’t seem to stick. There is no error, but I don’t see a default still.

    For the Firefox formatting, I did try a hard refresh. Is there a way to attach an to this thread to show what I mean? I guess it’s good to know that it’s supposed to work with Firefox.




    What operating system is your workstation? Which version of MySQL are you using there?

    If you have a blog, you can put the screenshot on your blog and link to it.

    The normal default value on the auto_toggle field in wp_linkcategories is N. (not that this has anything to do with your problem).

    I was able to change the default value to Y using [[phpMyAdmin]]. What MySql version are you using? I’m using 4.0.26 with phpMyAdmin verions 2.6.0-PL2.

    My workstation is running Windows XP. I have MySQL version 4.1.13a-nt. The database is something that I backed up from my hosting provider and restored on my workstation. The hosting provider is running RedHat Linux (not sure of the specifics beyond that) and MySQL 4.0.17-standard.

    I restored my backup and went through the process again. This time I deleted my wp-content folder entirely instead of just overwriting it. I also deleted .htaccess. I got the same database errors, but it looks like the Firefox problem has gone away.

    I also have found that the comment count seems to be incorrect. When I go to the Posts tab under “Manage”, there are errors which say:

    “WordPress database error: [Unknown column ‘column_count’ in ‘field list’] SELECT comment_count FROM em_posts WHERE ID = ’65′”

    This error repeats for every post listed. Is it possible that with the earlier errors that the comment_count wasn’t added as a column properly?

    I’ve been trying to make the changes to the MySQL database by hand, and I found that the ALTER TABLE {$table} ALTER COLUMN {$tablefield->Field} SET DEFAULT… statements cannot be run in isolation. They have to all be part of a single statement with multiple ALTER COLUMN specifications separated by commas. I don’t know if this is specific to my version of MySQL, but this wouldn’t succeed until I could run all of these defaults in one go.

    The comment_count error is because the addition of comment_count appears later in the list of changes, I believe.

    I’m going to go ahead and close this thread. The problem seems specific to the MySQL version that I have on my workstation. The upgrade proceeded without problems on my hosting provider. I guess someone should note that with MySQL 4.1.13a-nt that the alter table statements to add defaults don’t seem to work.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WordPress database errors during 2.0 upgrade’ is closed to new replies.