Author Topic: mysql.update.sql error  (Read 6083 times)

Offline cbrace

  • Full Member
  • ***
  • Posts: 75
mysql.update.sql error
« on: April 03, 2012, 10:36:33 AM »
Hi all,

It appears the database schema of my roundcube installation is out of date, and following the instructions of the installer, I have run the SQL update script in PhpMyAdmin. Alas it returns an error message:
Code: [Select]
SQL query:

ALTER TABLE  `messages` DROP INDEX  `idx` ,
DROP INDEX  `uid` ;


MySQL said:

#1091 - Can't DROP 'idx'; check that column/key exists
Any ideas what is going wrong here?

Thanks

roundcube v0.7.2
Code: [Select]
$ mysql --version
mysql  Ver 14.14 Distrib 5.5.22, for FreeBSD8.2 (amd64) using  5.2

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: mysql.update.sql error
« Reply #1 on: April 03, 2012, 11:23:04 AM »
You need to open the mysql update file and run the queries under the version your updating from.

Offline cbrace

  • Full Member
  • ***
  • Posts: 75
Re: mysql.update.sql error
« Reply #2 on: April 03, 2012, 04:13:23 PM »
Hmmm... I am not sure what version I am updating from. I know that sounds bizarre, but I update roundcube periodically via the FreeBSD ports system along with everything else on the server, and a few updates passed without my running the installer. I know, my bad.

I tried applying updates from several recent releases using the facility on page three of the installer with no luck :(((

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: mysql.update.sql error
« Reply #3 on: April 04, 2012, 02:55:41 AM »
Do you have a backup of the old files? You could check the version number in the index.php.

Offline cbrace

  • Full Member
  • ***
  • Posts: 75
Re: mysql.update.sql error
« Reply #4 on: April 04, 2012, 03:39:34 AM »
These are the versions I have installed over time on my FreeBSD server:
Code: [Select]
-rw-r--r--  1 root  wheel  2254703 Jan 12  2011 /usr/ports/distfiles/roundcubemail-0.5.tar.gz
-rw-r--r--  1 root  wheel  2291117 Aug 13  2011 /usr/ports/distfiles/roundcubemail-0.5.4.tar.gz
-rw-r--r--  1 root  wheel  2681342 Sep 28  2011 /usr/ports/distfiles/roundcubemail-0.6.tar.gz
-rw-r--r--  1 root  wheel  2710511 Jan  8 18:09 /usr/ports/distfiles/roundcubemail-0.7.1.tar.gz
-rw-r--r--  1 root  wheel  2714219 Mar 11 17:39 /usr/ports/distfiles/roundcubemail-0.7.2.tar.gz
-rw-r--r--  1 root  wheel  2707916 Dec 14 14:37 /usr/ports/distfiles/roundcubemail-0.7.tar.gz
Using the very useful "Version to update from" feature on page 3 of the installer, I have tried updating from every version from v5 upwards. No luck. Everytime I get a mySQL error.

This is what I see when first open page 3 of the installer in the DB section:

Quote
Check DB config

DSN (write):  OK
DB Schema:  NOT OK(Database schema differs)
Missing table 'cache_index'
Missing table 'cache_thread'
Missing table 'cache_messages'
Missing table 'dictionary'
Missing table 'searches'

You should run the update queries to get the schmea fixed.
Version to update from:   

Any ideas why these tables are not/have not been created?

Offline SKaero

  • Administrator
  • Hero Member
  • *****
  • Posts: 5,882
    • SKaero - Custom Roundcube development
Re: mysql.update.sql error
« Reply #5 on: April 04, 2012, 05:53:17 AM »
Since you tried so many different things it may have messed something up. If you hadn't updated the database since 0.5 then that should be the version you run the update from, have you tried to run the queries manually?

Offline cbrace

  • Full Member
  • ***
  • Posts: 75
Re: mysql.update.sql error
« Reply #6 on: April 04, 2012, 03:32:28 PM »
I ended up dropping the roundcube database and re-creating it. Everything is working fine now.  I will try to remember to check the DB schema every time the roundcube port gets updated. ;)