I have been recently switching hosting providers. I have transferred my database and installed Piwik as fresh installation on the new server. In the configuration screen I have provided the same custom prefix for SQL tables that was in my previous installation.
Immediately after installation, I am redirected to Piwik update screen where it asks me to update my MySQL database. I cannot perform it however because I get the following error message:
/home/<username>/<domainname>/piwik/core/Updates/1.8.3-b1.php:
Error trying to execute the query 'CREATE TABLE `<prefix>_report` (
`idreport` INT(11) NOT NULL AUTO_INCREMENT,
`idsite` INTEGER(11) NOT NULL,
`login` VARCHAR(100) NOT NULL,
`description` VARCHAR(255) NOT NULL,
`period` VARCHAR(10) NOT NULL,
`type` VARCHAR(10) NOT NULL,
`format` VARCHAR(10) NOT NULL,
`reports` TEXT NOT NULL,
`parameters` TEXT NULL,
`ts_created` TIMESTAMP NULL,
`ts_last_sent` TIMESTAMP NULL,
`deleted` tinyint(4) NOT NULL default 0,
PRIMARY KEY (`idreport`)
) DEFAULT CHARSET=utf8'.
The error was: SQLSTATE[42S01]: Base table or view already exists: 1050 Table '<prefix>_report' already exists
hi i ran across this exact same error message the only thing is in my sql admin I cannot see a table called.
piwik_report
I also got this error message via the shell script.
Error trying to execute the query ‘CREATE TABLE piwik_report ( idreport
INT(11) NOT NULL AUTO_INCREMENT, idsite INTEGER(11) NOT NULL, login
VARCHAR(100) NOT NULL, description VARCHAR(255) NOT NULL, period VARCHAR(10)
NOT NULL, type VARCHAR(10) NOT NULL, format VARCHAR(10) NOT NULL, reports
TEXT NOT NULL, parameters TEXT NULL, ts_created TIMESTAMP NULL, ts_last_sent TIMESTAMP NULL, deleted tinyint(4) NOT NULL default 0, PRIMARY
KEY (idreport) ) DEFAULT CHARSET=utf8’. The error was: SQLSTATE[42S01]: Base
table or view already exists: 1050 Table ‘piwik_report’ already exists
I encountered this problem after manually upgrading from 1.7.1 to 1.9.2. I’m running the following on my server:
Debian Squeeze
MySQL 5.5.25
PHP 5.4.9
I successfully resolved the issue (per the instructions printed in the browser under the error message) by changing the version_core value (in the piwik_option table) from 1.7.2-rc7 to 1.8.3-b1. I used MySQL Workbench to change the value. The command it executed was:
[b]UPDATE `piwik_data`.`piwik_option` SET `option_value`='1.8.3-b1' WHERE `option_name`='version_core';[/b]
(Where piwik_data is the name of my Piwik database.)
I refreshed the update screen in my browser and it completed successfully.