@anonymous-piwik-user opened this Issue on November 8th 2008

When I install Piwik 0.2.17 for the first time, I get a SQL statement error message when I press "Go!" for Step 3: databaseSetup. I'm running Ubuntu 8.10, with the latest packages needed for LAMP and Piwik.

Here was the error message that appeared:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option ( option_name VARCHAR( 64 ) NOT NULL , option_value LONGT' at line 1
Backtrace:
#0 /var/www/piwik/libs/Zend/Db/Statement.php(298): Zend_Db_Statement_Pdo->_execute(Array)
#1 /var/www/piwik/libs/Zend/Db/Adapter/Abstract.php(269): Zend_Db_Statement->execute(Array)
#2 /var/www/piwik/libs/Zend/Db/Adapter/Pdo/Abstract.php(206): Zend_Db_Adapter_Abstract->query('CREATE TABLE op...', Array)
#3 /var/www/piwik/core/Piwik.php(1054): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE op...')
#4 /var/www/piwik/plugins/Installation/Controller.php(204): Piwik::createTables()
#5 /var/www/piwik/plugins/Installation/Installation.php(62): Piwik_Installation_Controller->tablesCreation()
#6 function: Piwik_Installation->startInstallation(Object(Event_Notification))
#7 /var/www/piwik/libs/Event/Dispatcher.php(214): call_user_func_array(Array, Array)
#8 /var/www/piwik/core/PluginsManager.php(348): Event_Dispatcher->addObserver(Array, 'FrontController...')
#9 /var/www/piwik/core/PluginsManager.php(237): Piwik_PluginsManager->addPluginObservers(Object(Piwik_Installation))
#10 /var/www/piwik/core/PluginsManager.php(151): Piwik_PluginsManager->loadPlugins()
#11 /var/www/piwik/core/FrontController.php(225): Piwik_PluginsManager->setPluginsToLoad(Array)
#12 /var/www/piwik/index.php(51): Piwik_FrontController->init()
#13 {main}

Keywords: databaseSetup installation sql error

@francois2metz commented on November 10th 2008

I have the same error on Debian Etch.

@anonymous-piwik-user commented on November 10th 2008

the solution is quite easy.

When installing piwik without a prefix ('') option ends up as a reserved word in MySQL. The solution is

a) Add `` around the table/coulumns (would make sense to do at all times
or
b) Used a prefix for your piwik install.

I went with b, and spend ~4min to rename all tables, and re-run the upgrade guide. And bang, it just worked ;)

@mattab commented on November 24th 2008 Owner

cheers, it was fixed a few days ago following your ticket + a few emails from users

This Issue was closed on November 24th 2008
Powered by GitHub Issue Mirror