Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
914 views
in Q2A Core by

I want to upgrade my q&a but get this error:

10 upgrade step/s remaining... 

Running query: ALTER TABLE qa_posts ADD KEY lastuserid (lastuserid, updated, type) ... 



Question2Answer was unable to perform the installation query below. Please check the user in the config file has CREATE and ALTER permissions:

ALTER TABLE qa_posts ADD KEY lastuserid (lastuserid, updated, type)

Error 1061: Duplicate key name 'lastuserid'

The database user has the permissions ALTER und CREATE.

by
"Drop" all your Q2A tables in this database and then retry. if it was not fixed it might actually be a permission error. in your "hosting panel" go to "MySQL database" then add a new user, add the user to your database and check all ticks in permissions list, then update "qa-config.php" file.

1 Answer

0 votes
by

I don't know how this happened, but for some reason you already had a key that you shouldn't have, given the version of the Q2A database schema. Anyway you can comment out this line in qa-db-install.php then try again:

qa_db_upgrade_query('ALTER TABLE ^posts ADD KEY lastuserid (lastuserid, updated, type)');

...