When install,get error

i get the lastest code from svn ,when creating the tables in mysql ,I got the following errors:
the page is
http://localhost:8080/index.php?action=tab…le=Installation

Piwik # open source web analytics
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Backtrace:

#0 F:\eclipse workspace\piwik\libs\Zend\Db\Statement.php(298): Zend_Db_Statement_Pdo->_execute(Array)
#1 F:\eclipse workspace\piwik\libs\Zend\Db\Adapter\Abstract.php(269): Zend_Db_Statement->execute(Array)
#2 F:\eclipse workspace\piwik\libs\Zend\Db\Adapter\Pdo\Abstract.php(206): Zend_Db_Adapter_Abstract->query(‘CREATE TABLE pi…’, Array)
#3 F:\eclipse workspace\piwik\core\Piwik.php(1330): Zend_Db_Adapter_Pdo_Abstract->query(‘CREATE TABLE pi…’)
#4 F:\eclipse workspace\piwik\plugins\Installation\Controller.php(210): Piwik::createTables()
#5 F:\eclipse workspace\piwik\plugins\Installation\Installation.php(61): Piwik_Installation_Controller->tablesCreation()
#6 [internal function]: Piwik_Installation->startInstallation(Object(Piwik_Event_Notification))
#7 F:\eclipse workspace\piwik\libs\Event\Dispatcher.php(214): call_user_func_array(Array, Array)
#8 F:\eclipse workspace\piwik\core\PluginsManager.php(360): Event_Dispatcher->addObserver(Array, ‘FrontController…’)
#9 F:\eclipse workspace\piwik\core\PluginsManager.php(246): Piwik_PluginsManager->addPluginObservers(Object(Piwik_Installation))
#10 F:\eclipse workspace\piwik\core\PluginsManager.php(161): Piwik_PluginsManager->loadPlugins()
#11 F:\eclipse workspace\piwik\core\FrontController.php(224): Piwik_PluginsManager->setPluginsToLoad(Array)
#12 F:\eclipse workspace\piwik\index.php(48): Piwik_FrontController->init()
#13 {main}
Piwik homepage
Piwik Frequently Asked Questions
Piwik Documentation
Piwik Forums
Piwik Online Demo

the mysql version is 6.0.
thanks in advance:-)

maybe it’s the mysql which caused such errors.
I uninstall mysql 6,install mysql 5.1 solved this problem.

[quote=yifang @ Apr 19 2009, 01:52 AM]i get the lastest code from svn ,when creating the tables in mysql ,I got the following errors:
the page is
http://localhost:8080/index.php?action=tab…le=Installation

Piwik # open source web analytics
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes

Backtrace:

#0 F:\eclipse workspace\piwik\libs\Zend\Db\Statement.php(298): Zend_Db_Statement_Pdo->_execute(Array)
#1 F:\eclipse workspace\piwik\libs\Zend\Db\Adapter\Abstract.php(269): Zend_Db_Statement->execute(Array)
#2 F:\eclipse workspace\piwik\libs\Zend\Db\Adapter\Pdo\Abstract.php(206): Zend_Db_Adapter_Abstract->query(‘CREATE TABLE pi…’, Array)
#3 F:\eclipse workspace\piwik\core\Piwik.php(1330): Zend_Db_Adapter_Pdo_Abstract->query(‘CREATE TABLE pi…’)
#4 F:\eclipse workspace\piwik\plugins\Installation\Controller.php(210): Piwik::createTables()
#5 F:\eclipse workspace\piwik\plugins\Installation\Installation.php(61): Piwik_Installation_Controller->tablesCreation()
#6 [internal function]: Piwik_Installation->startInstallation(Object(Piwik_Event_Notification))
#7 F:\eclipse workspace\piwik\libs\Event\Dispatcher.php(214): call_user_func_array(Array, Array)
#8 F:\eclipse workspace\piwik\core\PluginsManager.php(360): Event_Dispatcher->addObserver(Array, ‘FrontController…’)
#9 F:\eclipse workspace\piwik\core\PluginsManager.php(246): Piwik_PluginsManager->addPluginObservers(Object(Piwik_Installation))
#10 F:\eclipse workspace\piwik\core\PluginsManager.php(161): Piwik_PluginsManager->loadPlugins()
#11 F:\eclipse workspace\piwik\core\FrontController.php(224): Piwik_PluginsManager->setPluginsToLoad(Array)
#12 F:\eclipse workspace\piwik\index.php(48): Piwik_FrontController->init()
#13 {main}
Piwik homepage
Piwik Frequently Asked Questions
Piwik Documentation
Piwik Forums
Piwik Online Demo

the mysql version is 6.0.
thanks in advance:-)[/quote]

1 Like

Same error for MySQL 8.0.20 and Matomo 3.13.6:

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 768 bytes

The causes in my case were:

  1. innodb_page_size = 4k
    I was changed it to default 16k and Matomo was installed as expected
    https://dev.mysql.com/doc/refman/8.0/en/innodb-limits.html :

    If you reduce the InnoDB page size to 8KB or 4KB by specifying the innodb_page_size option when creating the MySQL instance, the maximum length of the index key is lowered proportionally, based on the limit of 3072 bytes for a 16KB page size. That is, the maximum index key length is 1536 bytes when the page size is 8KB, and 768 bytes when the page size is 4KB.

  2. Matomo indexes on varchar columns with utf8 encoding

I suggest Matomo developers to consider the following:

  1. Document Matomo MySQL requirement ‘innodb_page_size = 16k’
  2. Use one-byte encoding for text and varchar/char indexed columns when there is no need for multi-byte encoding, for example for ‘usage_measurement_profiles’ table