SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown storage engine 'type'

Hello,

In an attempt to backup our installation of Piwik and the analytics data, I downloaded the PHP files and a database dump. In general, it works. I can log in and I can access certain pages, such as administration. I can see the websites and I can add new ones.

However, when I try to access the dashboard, the widgets don’t load and every widget shows the following error: SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown storage engine ‘type’.
Other dashboard pages show the following error:
‘Oops… there was a problem during the request. Maybe the server had a temporary issue, or maybe you requested a report with too much data. Please try again. If this error occurs repeatedly please contact your Piwik administrator for assistance.’

The ‘All Websites’ page shows the following error:
ERROR: Failed to get data from API: SQLSTATE[42000]: Syntax error or access violation: 1286 Unknown storage engine 'type' #0 C:\inetpub\wwwroot\piwik\libs\Zend\Db\Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array) #1 C:\inetpub\wwwroot\piwik\libs\Zend\Db\Adapter\Abstract.php(479): Zend_Db_Statement->execute(Array) #2 C:\inetpub\wwwroot\piwik\libs\Zend\Db\Adapter\Pdo\Abstract.php(238): Zend_Db_Adapter_Abstract->query('CREATE TABLE pi...', Array) #3 C:\inetpub\wwwroot\piwik\core\Db\Adapter\Pdo\Mysql.php(233): Zend_Db_Adapter_Pdo_Abstract->query('CREATE TABLE pi...', Array) #4 C:\inetpub\wwwroot\piwik\core\DataAccess\Model.php(230): Piwik\Db\Adapter\Pdo\Mysql->query('CREATE TABLE pi...') #5 C:\inetpub\wwwroot\piwik\core\DataAccess\ArchiveTableCreator.php(51): Piwik\DataAccess\Model->createArchiveTable('piwik_archive_n...', 'piwik_archive_n...') #6 C:\inetpub\wwwroot\piwik\core\DataAccess\ArchiveTableCreator.php(39): Piwik\DataAccess\ArchiveTableCreator::createArchiveTablesIfAbsent('piwik_archive_n...', 'archive_numeric') #7 C:\inetpub\wwwroot\piwik\core\DataAccess\ArchiveTableCreator.php(25): Piwik\DataAccess\ArchiveTableCreator::getTable(Object(Piwik\Date), 'numeric') #8 C:\inetpub\wwwroot\piwik\core\DataAccess\ArchiveSelector.php(56): Piwik\DataAccess\ArchiveTableCreator::getNumericTable(Object(Piwik\Date)) #9 C:\inetpub\wwwroot\piwik\core\ArchiveProcessor\Loader.php(170): Piwik\DataAccess\ArchiveSelector::getArchiveIdAndVisits(Object(Piwik\ArchiveProcessor\Parameters), 1454367599) #10 C:\inetpub\wwwroot\piwik\core\ArchiveProcessor\Loader.php(66): Piwik\ArchiveProcessor\Loader- >loadExistingArchiveIdFromDb() #11 C:\inetpub\wwwroot\piwik\core\Archive.php(894): Piwik\ArchiveProcessor\Loader- >prepareArchive('VisitsSummary') #12 C:\inetpub\wwwroot\piwik\core\Archive.php(708): Piwik\Archive->prepareArchive(Array, Object(Piwik\Site), Object(Piwik\Period\Day)) #13 C:\inetpub\wwwroot\piwik\core\Archive.php(660): Piwik\Archive->cacheArchiveIdsAfterLaunching(Array, Array) #14 C:\inetpub\wwwroot\piwik\core\Archive.php(598): Piwik\Archive->getArchiveIds(Array) #15 C:\inetpub\wwwroot\piwik\core\Archive.php(324): Piwik\Archive->get(Array, 'numeric') #16 C:\inetpub\wwwroot\piwik\plugins\VisitsSummary\API.php(35): Piwik\Archive->getDataTableFromNumeric(Array) #17 [internal function]: Piwik\Plugins\VisitsSummary\API->get('1', 'day', '2016-02-01,2016...', false, Array) #18 C:\inetpub\wwwroot\piwik\core\API\Proxy.php(211): call_user_func_array(Array, Array) #19 C:\inetpub\wwwroot\piwik\plugins\API\API.php(405): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'get', Array) #20 [internal function]: Piwik\Plugins\API\API->get('1', 'day', '2016-02-01,2016...', false, Array) #21 C:\inetpub\wwwroot\piwik\core\API\Proxy.php(211): call_user_func_array(Array, Array) #22 C:\inetpub\wwwroot\piwik\core\Plugin\Visualization.php(259): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'get', Array) #23 C:\inetpub\wwwroot\piwik\core\Plugin\Visualization.php(180): Piwik\Plugin\Visualization->loadDataTableFromAPI() #24 C:\inetpub\wwwroot\piwik\core\Plugin\ViewDataTable.php(414): Piwik\Plugin\Visualization->buildView() #25 C:\inetpub\wwwroot\piwik\core\Plugin\Controller.php(248): Piwik\Plugin\ViewDataTable->render() #26 C:\inetpub\wwwroot\piwik\plugins\VisitsSummary\Controller.php(126): Piwik\Plugin\Controller->renderView(Object(Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Evolution)) #27 C:\inetpub\wwwroot\piwik\plugins\VisitsSummary\Controller.php(42): Piwik\Plugins\VisitsSummary\Controller- >getEvolutionGraph(false, Array, 'getIndexGraph') #28 [internal function]: Piwik\Plugins\VisitsSummary\Controller->index() #29 C:\inetpub\wwwroot\piwik\core\FrontController.php(494): call_user_func_array(Array, Array) #30 C:\inetpub\wwwroot\piwik\core\FrontController.php(94): Piwik\FrontController->doDispatch('VisitsSummary', 'index', Array) #31 C:\inetpub\wwwroot\piwik\core\dispatch.php(34): Piwik\FrontController->dispatch() #32 C:\inetpub\wwwroot\piwik\index.php(27): require_once('C:\\inetpub\\wwwr...') #33 {main}

This is on IIS 8.5 with MySQL 5.7 and PHP 7.0.0. How can I solve this issue?

Edit: just for fun, I changed core/Db/Settings.php to always make getEngine return ‘InnoDB’. That fixes that problem, but results in the following message when I try to access the visits over time widget:

SQLSTATE[HY000]: General error: 2006 MySQL server has gone away

Other widgets give the generic ‘Oops, there was a problem during the request’ message.

Thanks in advance,
Robbert

You have to set up archiving. See this guide: How to Set up Auto-Archiving of Your Reports - Analytics Platform - Matomo
It may be also needed to tweak some MySQL settings.

Thank you for your response. How is archiving related to this? I don’t recall having to set up archiving on the hosted environment and it all just worked.
Anyway, I tried the web cron archive method. The data is pretty much static at this point, so there should be no need to archive more than once, right? It resulted in this:

INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] --------------------------- INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] INIT INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] Running Piwik 2.14.2 as Super User INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] --------------------------- INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] NOTES INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] - If you execute this script at least once per hour (or more often) in a crontab, you may disable 'Browser trigger archiving' in Piwik UI > Settings > General Settings. INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] See the doc at: http://piwik.org/docs/setup-auto-archiving/ INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] - Reports for today will be processed at most every 150 seconds. You can change this value in Piwik UI > Settings > General Settings. INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] - Reports for the current week/month/year will be refreshed at most every 3600 seconds. INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] - Will process 4 websites with new visits since 7 days 0 hours , IDs: 11, 51, 61, 91 INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] - Will process 4 other websites because some old data reports have been invalidated (eg. using the Log Import script) , IDs: 21, 41, 11, 91 INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] --------------------------- INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] START INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] Starting Piwik reports archiving... INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] Will pre-process for website id = 11, period = day, date = last52 INFO CoreAdminHome[2016-03-03 06:53:38] [8ff1c] - pre-processing all visits ERROR CoreAdminHome[2016-03-03 06:53:39] [8ff1c] Got invalid response from API request: ?module=API&method=API.get&idSite=11&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' ERROR CoreAdminHome[2016-03-03 06:53:39] [8ff1c] Empty or invalid response '' for website id 11, Time elapsed: 0.797s, skipping INFO CoreAdminHome[2016-03-03 06:53:39] [8ff1c] Will pre-process for website id = 51, period = day, date = last52 INFO CoreAdminHome[2016-03-03 06:53:39] [8ff1c] - pre-processing all visits ERROR CoreAdminHome[2016-03-03 06:53:39] [8ff1c] Got invalid response from API request: ?module=API&method=API.get&idSite=51&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' ERROR CoreAdminHome[2016-03-03 06:53:39] [8ff1c] Empty or invalid response '' for website id 51, Time elapsed: 0.336s, skipping INFO CoreAdminHome[2016-03-03 06:53:39] [8ff1c] Will pre-process for website id = 61, period = day, date = last52 INFO CoreAdminHome[2016-03-03 06:53:39] [8ff1c] - pre-processing all visits ERROR CoreAdminHome[2016-03-03 06:53:40] [8ff1c] Got invalid response from API request: ?module=API&method=API.get&idSite=61&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' ERROR CoreAdminHome[2016-03-03 06:53:40] [8ff1c] Empty or invalid response '' for website id 61, Time elapsed: 0.331s, skipping INFO CoreAdminHome[2016-03-03 06:53:40] [8ff1c] Will pre-process for website id = 91, period = day, date = last52 INFO CoreAdminHome[2016-03-03 06:53:40] [8ff1c] - pre-processing all visits ERROR CoreAdminHome[2016-03-03 06:53:40] [8ff1c] Got invalid response from API request: ?module=API&method=API.get&idSite=91&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' ERROR CoreAdminHome[2016-03-03 06:53:40] [8ff1c] Empty or invalid response '' for website id 91, Time elapsed: 0.364s, skipping INFO CoreAdminHome[2016-03-03 06:53:40] [8ff1c] Will pre-process for website id = 21, period = day, date = last52 INFO CoreAdminHome[2016-03-03 06:53:40] [8ff1c] - pre-processing all visits INFO CoreAdminHome[2016-03-03 06:53:42] [8ff1c] Archived website id = 21, period = day, 0 segments, 0 visits in last last52 days, 0 visits today, Time elapsed: 0.002s INFO CoreAdminHome[2016-03-03 06:53:42] [8ff1c] Will pre-process for website id = 21, period = week, date = last220 INFO CoreAdminHome[2016-03-03 06:53:42] [8ff1c] - pre-processing all visits ERROR CoreAdminHome[2016-03-03 06:53:42] [8ff1c] Got invalid response from API request: ?module=API&method=API.get&idSite=21&period=week&date=last220&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:42] [8ff1c] Archived website id = 21, period = week, 0 segments, 0 visits in last last220 weeks, 0 visits this week, Time elapsed: 0.368s INFO CoreAdminHome[2016-03-03 06:53:42] [8ff1c] Will pre-process for website id = 21, period = month, date = last52 INFO CoreAdminHome[2016-03-03 06:53:42] [8ff1c] - pre-processing all visits ERROR CoreAdminHome[2016-03-03 06:53:43] [8ff1c] Got invalid response from API request: ?module=API&method=API.get&idSite=21&period=month&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:43] [8ff1c] Archived website id = 21, period = month, 0 segments, 0 visits in last last52 months, 0 visits this month, Time elapsed: 0.332s INFO CoreAdminHome[2016-03-03 06:53:43] [8ff1c] Will pre-process for website id = 21, period = year, date = last7 INFO CoreAdminHome[2016-03-03 06:53:43] [8ff1c] - pre-processing all visits ERROR CoreAdminHome[2016-03-03 06:53:43] [8ff1c] Got invalid response from API request: ?module=API&method=API.get&idSite=21&period=year&date=last7&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:43] [8ff1c] Archived website id = 21, period = year, 0 segments, 0 visits in last last7 years, 0 visits this year, Time elapsed: 0.344s INFO CoreAdminHome[2016-03-03 06:53:43] [8ff1c] Archived website id = 21, 4 API requests, Time elapsed: 3.114s [5/6 done] INFO CoreAdminHome[2016-03-03 06:53:43] [8ff1c] Will pre-process for website id = 41, period = day, date = last52 INFO CoreAdminHome[2016-03-03 06:53:43] [8ff1c] - pre-processing all visits INFO CoreAdminHome[2016-03-03 06:53:45] [8ff1c] Archived website id = 41, period = day, 0 segments, 0 visits in last last52 days, 0 visits today, Time elapsed: 0.001s INFO CoreAdminHome[2016-03-03 06:53:45] [8ff1c] Will pre-process for website id = 41, period = week, date = last219 INFO CoreAdminHome[2016-03-03 06:53:45] [8ff1c] - pre-processing all visits ERROR CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Got invalid response from API request: ?module=API&method=API.get&idSite=41&period=week&date=last219&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Archived website id = 41, period = week, 0 segments, 0 visits in last last219 weeks, 0 visits this week, Time elapsed: 0.340s INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Will pre-process for website id = 41, period = month, date = last52 INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] - pre-processing all visits ERROR CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Got invalid response from API request: ?module=API&method=API.get&idSite=41&period=month&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Archived website id = 41, period = month, 0 segments, 0 visits in last last52 months, 0 visits this month, Time elapsed: 0.338s INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Will pre-process for website id = 41, period = year, date = last7 INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] - pre-processing all visits ERROR CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Got invalid response from API request: ?module=API&method=API.get&idSite=41&period=year&date=last7&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Archived website id = 41, period = year, 0 segments, 0 visits in last last7 years, 0 visits this year, Time elapsed: 0.332s INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Archived website id = 41, 4 API requests, Time elapsed: 3.278s [6/6 done] INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Done archiving! INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] --------------------------- INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] SUMMARY INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Total visits for today across archived websites: 0 INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Archived today's reports for 2 websites INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Archived week/month/year for 2 websites INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Skipped 7 websites: no new visit since the last script execution INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Skipped 0 websites day archiving: existing daily reports are less than 150 seconds old INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Skipped 0 websites week/month/year archiving: existing periods reports are less than 3600 seconds old INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Total API requests: 8 INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] done: 2/6 33%, 0 vtoday, 2 wtoday, 2 wperiods, 8 req, 8221 ms, 14 errors. INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Time elapsed: 8.221s INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] --------------------------- INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] SCHEDULED TASKS INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Starting Scheduled tasks... INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Scheduler: executing task Piwik\Plugins\CoreAdminHome\Tasks.purgeOutdatedArchives... INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Purging archives in 16 archive tables. INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Deleted 2 rows in archive tables (numeric + blob) for 2015-01-15. INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Deleted 45 rows in archive tables (numeric + blob) for 2015-07-15. INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Deleted 52 rows in archive tables (numeric + blob) for 2016-01-15. INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Deleted 112 rows in archive tables (numeric + blob) for 2016-02-15. INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Scheduler: finished. Time elapsed: 0.070s INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Scheduler: executing task Piwik\Plugins\ExamplePlugin\Tasks.myTaskWithParam_anystring... INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Scheduler: finished. Time elapsed: 0.000s INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Scheduler: executing task Piwik\Plugins\ExamplePlugin\Tasks.myTask... INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Scheduler: finished. Time elapsed: 0.000s INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Scheduler: executing task Piwik\Plugins\UsersManager\Tasks.setUserDefaultReportPreference... INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Scheduler: finished. Time elapsed: 0.002s INFO CoreAdminHome[2016-03-03 06:53:46] [8ff1c] Scheduler: executing task Piwik\Plugins\CoreAdminHome\Tasks.purgeInvalidatedArchives... INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: finished. Time elapsed: 0.066s INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: executing task Piwik\Plugins\PrivacyManager\Tasks.deleteReportData... INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: finished. Time elapsed: 0.002s INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: executing task Piwik\Plugins\PrivacyManager\Tasks.deleteLogData... INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: finished. Time elapsed: 0.001s INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: executing task Piwik\Plugins\CorePluginsAdmin\Tasks.clearAllCacheEntries... INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: finished. Time elapsed: 0.026s INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: executing task Piwik\Plugins\CorePluginsAdmin\Tasks.sendNotificationIfUpdatesAvailable... INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: finished. Time elapsed: 0.001s INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: executing task Piwik\Plugins\CoreAdminHome\Tasks.optimizeArchiveTable... INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: finished. Time elapsed: 0.015s INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: executing task Piwik\Plugins\UserCountry\GeoIPAutoUpdater.update... INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: finished. Time elapsed: 0.031s INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: executing task Piwik\Plugins\CoreUpdater\Tasks.sendNotificationIfUpdateAvailable... INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Scheduler: finished. Time elapsed: 0.004s INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] done INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] --------------------------- INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] --------------------------- INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] SUMMARY OF ERRORS INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=11&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Empty or invalid response '' for website id 11, Time elapsed: 0.797s, skipping INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=51&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Empty or invalid response '' for website id 51, Time elapsed: 0.336s, skipping INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=61&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Empty or invalid response '' for website id 61, Time elapsed: 0.331s, skipping INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=91&period=day&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Empty or invalid response '' for website id 91, Time elapsed: 0.364s, skipping INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=21&period=week&date=last220&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=21&period=month&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=21&period=year&date=last7&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=41&period=week&date=last219&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=41&period=month&date=last52&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' INFO CoreAdminHome[2016-03-03 06:53:47] [8ff1c] Error: Got invalid response from API request: ?module=API&method=API.get&idSite=41&period=year&date=last7&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:63:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}' ERROR CoreAdminHome[2016-03-03 06:53:47] [8ff1c] 14 total errors during this script execution, please investigate and try and fix these errors. Error: 14 total errors during this script execution, please investigate and try and fix these errors.

What MySQL settings would have to be tweaked?

Or, more interesting: where did I go wrong? I simply installed PHP 7.0.0 from the Microsoft Web Platform Installer and MySQL 5.7.11 Community Server from the Oracle installer. I didn’t change any of the default settings. Then I downloaded a full dump of the Piwik data from my host (basically, a large file with INSERT INTO statements) and imported that into my local MySQL database. In IIS, I made a virtual directory and converted that to an application, and placed the a copy of the production Piwik files in there after changing the Piwik database settings.

Just to be clear: this is running on my local machine. There’s no need to gather statistics, only to view them.

let’s try the simplest solution How do I fix the error “Mysql Server has gone away”? - Analytics Platform - Matomo

Thank you for response, but that didn’t work. It immediately errors out (same error) after loading the page. This is the ini file:

[mysqld]

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
max_allowed_packet=268435456
wait_timeout=28800
interactive_timeout=28800

I remember these config files being much larger in the past. Maybe I should install a different version of MySQL?

Support for mysql 5.7 has been added in the latest piwik version 2.16.
Try again with new version.

Thank you. I haven’t tried that, but removing MySQL 5.7.11 and installing MySQL 5.5.45 on my local machine solved the problem.