News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Problems with Upgrade.php - Database related

Started by natenkiki2004, March 16, 2015, 02:01:49 AM

Previous topic - Next topic

natenkiki2004

So... I was wanting to upgrade the forum database to UTF-8 and when doing so I get this error:
QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'key key varbinary(255) NOT NULL default ''' at line 10
File: /home/xxxxxx/public_html/forum/Sources/ManageMaintenance.php
Line: 666

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.9, while your database is at version 2.0.8. The above error might possibly go away if you execute the latest version of upgrade.php.

So, like it says, I ran Upgrade.php. Problem is, I get this far and it stalls out:
QuoteExecuting database changes
Please be patient - this may take some time on large forums. The time elapsed increments from the server to show progress is being made!
Executing: "Adding Some Additional Functionality." (17 of 42)

!!Error!
Incorrect table definition; there can be only one auto column and it must be defined as a key

I cannot find any information about what's going on or what specifically failed. I looked through all the tables and there aren't any multiple 'auto increment' columns. If it helps, this is the base64 data from the URL on the error page:
a:6:{s:7:"curstep";i:0;s:4:"lang";s:7:"english";s:3:"rid";i:3675;s:4:"pass";i:0;s:5:"debug";i:0;s:2:"js";i:0;}


Any ideas?



*EDIT*
In the Settings.php, since I had to manually turn off maintenance mode, I see this:
$db_character_set = 'utf8';
Is the database already UTF-8? Why would it offer to convert it? Is there something I'm missing here?

In phpMyAdmin, I see a mix of "utf8_general_ci", "latin2_general_ci" and "latin1_swedish_ci".

This forum has been around a while, been converted and re-worked, migrated and edited, themed & re-themed. A LOT has happened to it and I wouldn't be surprised if things got messed up along the way.

Thanks.

natenkiki2004

Looks like the mod "Bad Behavior" had something to do with this. A poorly named column in the table 'smf_log_badbehavior' which was 'key'. Caused the MySQL command to fail with improper syntax. Renamed that column and it's going through converting the tables right now. Looking at the database, the forum must have been half-converted for quite a while.

natenkiki2004

Ok, forum is migrated to UTF-8, no problems there seemingly. However, the Upgrade.php error still bugs me. I realized I could restart the process with extra debugging info, here's what I got:

Executing database changes
Please be patient - this may take some time on large forums. The time elapsed increments from the server to show progress is being made!
Executing: "Adding Some Additional Functionality." (17 of 42)

Renaming table columns...done
Converting "log_online"...done
Implementing board redirects...done
Creating spider table...done
Removing a spider...done
Creating spider hit tracking table...done
Making some changes to spider hit table...done
Creating spider statistic table...done
Resetting settings_updated...done
Changing stats settings...done
Enable cache if upgrading from 1.1 and lower..done
Changing visual verification setting...done
Changing visual verification setting, again...done
Changing default personal text setting...done
Removing allow hide email setting...done
Ensuring stats index setting present...done
Ensuring forum width setting present...done
Replacing old calendar settings...done
Fixing the calendar holidays if they were somehow wrong before...done
Deleting old calendar settings...done
Adjusting calendar maximum year...done
Adding advanced signature settings...done
Updating spam protection settings...done
Adjusting timezone settings...done
Checking theme layers are correct for default themes...done
Adding index to log_notify table...done
Creating "custom_fields" table...done
Adding search ability to custom fields...done
Fixing default value field length...done
Enhancing privacy settings for custom fields...done
Checking display fields setup correctly...done
Adding new custom fields columns...done
Creating "log_digest" table...done
Adding digest option to "members" table...done
Creating "log_packages" table...done
Adding extra "log_packages" columns...done
Changing URL to SMF package server...done
Creating "mail_queue" table...done
Adding new mail queue settings...done
Change mail queue indexes...done
Adding type to mail queue...done
Creating "log_reported" table...done
Creating "log_reported_comments" table...done
Adding moderator center permissions...done
Adding moderation center preferences...done
Creating member notices table...done
Creating comments table...done
Adding user warning column...done
Ensuring warning settings are present...done
Creating "log_group_requests" table...done
Adding new membergroup table columns...done
Creating "group_moderators" table...done
Altering attachment table...done
Adding file hash...done
Populate the attachment extension...done
Updating thumbnail attachments JPG...done
Updating thumbnail attachments PNG...done
Calculating attachment mime types...done
Creating "approval_queue" table...done
Adding approved column to attachments table...done
Adding approved column to messages table...done
Adding unapproved count column to topics table...done
Adding approved column to topics table...done
Adding approved columns to boards table...done
Adding post moderation permissions...done
Adding columns to log_errors table...done
Updating error log table...done
Creating Scheduled Task Table...done
Populating Scheduled Task Table...done
Adding the simple machines scheduled task...done
Deleting old scheduled task items...done
Moving auto optimise settings to scheduled task...done
Creating Scheduled Task Log Table...done
Adding new scheduled task setting...done
Setting the birthday email template if not set...done
Creating "permission_profiles" table...done
Adding profile columns to boards table...done
Adding profile columns to board permission table...done
Cleaning up some 2.0 Beta 1 permission profile bits...done
Migrating old board profiles to profile system...done
Removing old board permissions column...done
Check the predefined profiles all have the right permissions...done
Adding inherited permissions...done
Make sure admins and moderators don't inherit...done
Deleting old permission settings...done
Removing old permission_mode column...done
Adding column to hold the boards being ignored ...done
Purge flood control ...done
Adding advanced flood control ...done
Sorting out flood control keys ...done
Adding guest voting ...done


!!Error!
Incorrect table definition; there can be only one auto column and it must be defined as a key

margarett

Quote from: natenkiki2004 on March 16, 2015, 02:01:49 AM
Quote
Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 2.0.9, while your database is at version 2.0.8. The above error might possibly go away if you execute the latest version of upgrade.php.

So, like it says, I ran Upgrade.php. Problem is, I get this far and it stalls out:
There is no need to run upgrade. There are no database changes since 2.0 RC-something, so don't waste any more time in that.

In any case, your problem should be related to any MOD that you installed as that issue doesn't occur in a standard SMF install...
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

natenkiki2004

Is there any way to figure out what might be going wrong where? Like at what point did the SMF script stop/fail? I looked through the database and couldn't find any obvious problems with the tables.

Advertisement: