Answers.Body: <p>Here's a patch that seems to address the issue, although there could still be compatibility issues in the PEAR mysql and mysqli library versions used by CiviCRM.</p>
  
  <p>This patch is for CiviCRM 4.7.4:</p>
  
  <pre><code>diff --git a/civicrm/CRM/Core/Lock.php b/civicrm/CRM/Core/Lock.php
  index b594e0b..4643fc4 100644
  --- a/civicrm/CRM/Core/Lock.php
  +++ b/civicrm/CRM/Core/Lock.php
  @@ -121,6 +121,9 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface {
       else {
         $this-&gt;_name = $database . '.' . $domainID . '.' . $name;
       }
  +    if (strlen($this-&gt;_name) &gt; 64) {
  +      $this-&gt;_name = sha1( $this-&gt;_name );
  +    }
       if (defined('CIVICRM_LOCK_DEBUG')) {
         CRM_Core_Error::debug_log_message('trying to construct lock for ' . $this-&gt;_name);
       }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-11T09:59:00.750Z
Answers.Text: this looks good to me, what implications might there be of changing the names ? are these only temporary tables ?
Answers.UserDisplayName: jowan sebastian
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-16T09:53:11.207Z
Answers.LastActivityDate: 2016-03-16T11:18:41.760Z
Answers.LastEditDate: 2016-03-16T11:18:41.760Z
Answers.UserDisplayName: Andrew
Answers.Body: <p>Solution, don't upgrade to MySQL 5.7.x until this incompatibility is addressed:</p>
  
  <blockquote>
    <p>The MDL subsystem imposes a limit of 64 characters on lock names, so
    this limit now also applies to named locks. Previously, no length
    limit was enforced.</p>
  </blockquote>
  
  <p><a href="https://dev.mysql.com/doc/refman/5.7/en/upgrading-from-previous-series.html#upgrade-sql-changes" rel="nofollow">MySql 5.7 Reference Manual, 2.11.1.1 Changes Affecting Upgrades to MySQL 5.7</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-07T03:00:15.850Z
Answers.Text: Well... that's bittersweet. Sounds like MySQL 5.7 is two steps forward (enabling processes to hold multiple locks) and one step back (limiting the name length). If we could ditch MySQL <=5.6, then one could rewrite `CRM_Core_Lock` to be cleaner and more correct. Alas, we'll have to support both...
Answers.UserDisplayName: Tim Otten
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-07T03:04:27.857Z
Answers.Text: You might be able to work-around by putting this in civicrm.settings.php;
  define('CIVICRM_CACHE_LOCK', 'CRM_Core_Lock::createGlobalLock');
  define('CIVICRM_DATA_LOCK', 'CRM_Core_Lock::createGlobalLock');
  define('CIVICRM_WORK_LOCK', 'CRM_Core_Lock::createGlobalLock');
Answers.UserDisplayName: Tim Otten
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-07T01:20:27.343Z
Answers.LastActivityDate: 2015-12-07T01:20:27.343Z
Answers.UserDisplayName: Tim Renner
Answers.Body: <p>You should get a full error message if you turn on debugging go to</p>
  
  <p>Administer menu > System Settings > Debugging and Error Handling, select "Yes" to both "Enable Debugging" and "Display Backtrace", and press "Save"</p>
  
  <p>and then re-try</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-01T18:15:07.477Z
Answers.Text: Thanks for the suggestion. I can't get to any civicrm pages.
Answers.UserDisplayName: Tim Renner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T15:33:25.627Z
Answers.Text: I edited the problem description.
Answers.UserDisplayName: Tim Renner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-01T07:54:45.517Z
Answers.LastActivityDate: 2015-12-01T07:54:45.517Z
Answers.UserDisplayName: eileen
Answers.Body: <p>Check once after deleting the templates_c folder (temporary).</p>
  
  <p>../files/civicrm/templates_c/</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-01T18:14:26.423Z
Answers.Text: Thanks for the suggestion. Deleting civi's templates_c folder didn't fix this.
Answers.UserDisplayName: Tim Renner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-01T18:30:04.410Z
Answers.Text: Can please check civicrm.settings. php file for database configuration. Also browser console log.
Answers.UserDisplayName: Prem Patel
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-01T18:31:41.247Z
Answers.Text: Also can you paste here the civicrm config log errors.
Answers.UserDisplayName: Prem Patel
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-02T04:59:03.637Z
Answers.Text: Pasted backtrace at end of question.
Answers.UserDisplayName: Tim Renner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-01T16:29:54.117Z
Answers.LastActivityDate: 2015-12-01T16:29:54.117Z
Answers.UserDisplayName: Prem Patel
Answers.Body: <p>Another solution is to upgrade at least to CiviCRM 4.6.16 or to CiviCRM 4.7.7 or you can also patch your installation.</p>
  
  <p>If you are familair with patches you can also download a patch from the civi site. <a href="https://github.com/civicrm/civicrm-core/commit/3f7df5902facad68489e225b504a887c2b45eb91.diff" rel="nofollow">https://github.com/civicrm/civicrm-core/commit/3f7df5902facad68489e225b504a887c2b45eb91.diff</a> and then apply that patch to your civicrm installation.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-19T20:09:35.623Z
Answers.Text: Thank you Jaap. Users can either patch older civi or use the versions you named if they need MySQL >= 5.7. Good news!
Answers.UserDisplayName: Tim Renner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-04-30T18:08:34.550Z
Answers.Text: Had this problem migrating an older site to a new server with MySQL 5.7. Thanks for posting the fix!
Answers.UserDisplayName: jackrabbithanna
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-08-18T09:14:14.613Z
Answers.LastActivityDate: 2016-08-18T09:14:14.613Z
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Body: <p>After complete wipe and install new MYSQL 5.7.9 can't get fresh civi drupal up and running but existing drupal sites work fine. So I'd like to know if others can install on this combination or if a db downgrade is in order. Or something else? help!</p>
  
  <p>My configuration:</p>
  
  <p>OS X 10.11.1,
  MySQL 5.7.9,
  PHP 5.5.21,
  Drupal 7.41,
  CiviCRM 4.6.10</p>
  
  <p>At first I was trying to migrate a site from live to local, many fails. So I stripped it down to the following steps...</p>
  
  <ol>
  <li>mysql drop database name</li>
  <li>mysql create database name</li>
  <li>untar drupal as ~/Sites/drupal</li>
  <li>localhost/drupal/install.php (Standard)</li>
  <li>untar civicrm in ~/Sites/drupal/sites/all/modules</li>
  <li>admin/config/development/maintenance set drupal maintenance mode</li>
  <li>chmod u+w sites/default</li>
  <li>sites/all/modules/civicrm/install/index.php</li>
  </ol>
  
  <p><strong>Install gives error below and subsequently module is enabled in drupal but all civicrm urls give a shorter version of the same error:</strong></p>
  
  <pre>Error
  
  The website encountered an unexpected error. Please try again later.
  Error message
  
  Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 692 of /Users/rota/Sites/drupal/includes/bootstrap.inc).
  CiviCRM_API3_Exception: DB Error: unknown error in civicrm_api3() (line 45 of /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/api.php).
  Status message
  
  CiviCRM theme configuration setting is available under Administer > Appearance > Administration theme</pre>
  
  <p><strong>Backtrace</strong></p>
  
  <pre>North-Fork:ConfigAndLog rota$ cat Civicrm.cde18d9d66ead3de8f5c02e6d89d7355.log.201512010951
  Nov 30 20:53:18  [info] $backTrace = #0 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Error.php(897): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  #3 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), "SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #4 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), "SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #5 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...", "DB_Error", TRUE)
  #6 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-1, NULL, NULL, NULL, "3057 ** Incorrect user-level lock name 'pincsf.1.cache.CiviCRM setting Specs_...")
  #7 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
  #8 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #9 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #10 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #11 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #12 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(1234): CRM_Core_DAO->query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...", TRUE)
  #13 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Lock.php(151): CRM_Core_DAO::singleValueQuery("SELECT GET_LOCK( %1, %2 )", (Array:2))
  #14 /Users/rota/Sites/drupal/sites/all/modules/civicrm/Civi/Core/Lock/LockManager.php(84): CRM_Core_Lock->acquire(NULL)
  #15 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Cache.php(154): Civi\Core\Lock\LockManager->acquire("cache.CiviCRM setting Specs_settingsMetadata___name_resCacheCode._")
  #16 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(715): CRM_Core_BAO_Cache::setItem((Array:1), "CiviCRM setting Specs", "settingsMetadata___name_resCacheCode", NULL)
  #17 /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/v3/Setting.php(66): CRM_Core_BAO_Setting::getSettingSpecification(NULL, (Array:1), NULL, NULL)
  #18 /Users/rota/Sites/drupal/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_setting_getfields((Array:2))
  #19 /Users/rota/Sites/drupal/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
  #20 /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("setting", "getfields", (Array:2), NULL)
  #21 /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/api.php(43): civicrm_api("setting", "getfields", (Array:2))
  #22 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(591): civicrm_api3("setting", "getfields", (Array:2))
  #23 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(382): CRM_Core_BAO_Setting::validateSettingsInput((Array:1), (Array:0))
  #24 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(558): CRM_Core_BAO_Setting::setItem("B8kFl", "CiviCRM Preferences", "resCacheCode")
  #25 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(567): CRM_Core_Resources->setCacheCode("B8kFl")
  #26 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(144): CRM_Core_Resources->resetCacheCode()
  #27 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(122): CRM_Core_Resources->__construct(Object(CRM_Extension_Mapper), Object(CRM_Utils_Cache_SqlGroup), "resCacheCode")
  #28 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(48): CRM_Core_Resources::singleton()
  #29 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(223): civicrm_html_head()
  #30 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(103): civicrm_initialize()
  #31 [internal function](): civicrm_menu()
  #32 /Users/rota/Sites/drupal/includes/menu.inc(2812): call_user_func("civicrm_menu")
  #33 /Users/rota/Sites/drupal/includes/menu.inc(2775): menu_router_build()
  #34 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(788): menu_rebuild()
  #35 [internal function](): civicrm_enable()
  #36 /Users/rota/Sites/drupal/includes/module.inc(905): call_user_func_array("civicrm_enable", (Array:0))
  #37 /Users/rota/Sites/drupal/includes/module.inc(484): module_invoke("civicrm", "enable")
  #38 /Users/rota/Sites/drupal/sites/all/modules/civicrm/install/index.php(1330): module_enable((Array:2))
  #39 /Users/rota/Sites/drupal/sites/all/modules/civicrm/install/index.php(271): Installer->install((Array:5))
  #40 {main}</pre>
  
Tags: <drupal><mysql><installation><4.6.10>
Title: INSTALLER fails. Database can't "SELECT GET_LOCK" at civicrm/install/index.php(271)
ThreadText: # INSTALLER fails. Database can't "SELECT GET_LOCK" at civicrm/install/index.php(271)
  
  (Asked by: username_0 on 2015-12-01)
  
  After complete wipe and install new MYSQL 5.7.9 can't get fresh civi drupal up and running but existing drupal sites work fine. So I'd like to know if others can install on this combination or if a db downgrade is in order. Or something else? help!
  
  My configuration:
  
  OS X 10.11.1,
  MySQL 5.7.9,
  PHP 5.5.21,
  Drupal 7.41,
  CiviCRM 4.6.10
  
  At first I was trying to migrate a site from live to local, many fails. So I stripped it down to the following steps...
  
  1. mysql drop database name
  2. mysql create database name
  3. untar drupal as ~/Sites/drupal
  4. localhost/drupal/install.php (Standard)
  5. untar civicrm in ~/Sites/drupal/sites/all/modules
  6. admin/config/development/maintenance set drupal maintenance mode
  7. chmod u+w sites/default
  8. sites/all/modules/civicrm/install/index.php
  
  **Install gives error below and subsequently module is enabled in drupal but all civicrm urls give a shorter version of the same error:**
  
  ```
  Error
  
  The website encountered an unexpected error. Please try again later.
  Error message
  
  Warning: ini_set(): A session is active. You cannot change the session module's ini settings at this time in drupal_environment_initialize() (line 692 of /Users/rota/Sites/drupal/includes/bootstrap.inc).
  CiviCRM_API3_Exception: DB Error: unknown error in civicrm_api3() (line 45 of /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/api.php).
  Status message
  
  CiviCRM theme configuration setting is available under Administer > Appearance > Administration theme
  ```
  
  **Backtrace**
  
  ```
  North-Fork:ConfigAndLog rota$ cat Civicrm.cde18d9d66ead3de8f5c02e6d89d7355.log.201512010951
  Nov 30 20:53:18  [info] $backTrace = #0 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Error.php(897): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 [internal function](): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
  #3 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: unknown error", -1, 16, (Array:2), "SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #4 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-1, 16, (Array:2), "SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #5 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -1, NULL, NULL, "SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...", "DB_Error", TRUE)
  #6 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/mysql.php(895): DB_common->raiseError(-1, NULL, NULL, NULL, "3057 ** Incorrect user-level lock name 'pincsf.1.cache.CiviCRM setting Specs_...")
  #7 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
  #8 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #9 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(2442): DB_common->query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #10 /Users/rota/Sites/drupal/sites/all/modules/civicrm/packages/DB/DataObject.php(1634): DB_DataObject->_query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #11 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(325): DB_DataObject->query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...")
  #12 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/DAO.php(1234): CRM_Core_DAO->query("SELECT GET_LOCK( 'pincsf.1.cache.CiviCRM setting Specs_settingsMetadata___nam...", TRUE)
  #13 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Lock.php(151): CRM_Core_DAO::singleValueQuery("SELECT GET_LOCK( %1, %2 )", (Array:2))
  #14 /Users/rota/Sites/drupal/sites/all/modules/civicrm/Civi/Core/Lock/LockManager.php(84): CRM_Core_Lock->acquire(NULL)
  #15 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Cache.php(154): Civi\Core\Lock\LockManager->acquire("cache.CiviCRM setting Specs_settingsMetadata___name_resCacheCode._")
  #16 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(715): CRM_Core_BAO_Cache::setItem((Array:1), "CiviCRM setting Specs", "settingsMetadata___name_resCacheCode", NULL)
  #17 /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/v3/Setting.php(66): CRM_Core_BAO_Setting::getSettingSpecification(NULL, (Array:1), NULL, NULL)
  #18 /Users/rota/Sites/drupal/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_setting_getfields((Array:2))
  #19 /Users/rota/Sites/drupal/sites/all/modules/civicrm/Civi/API/Kernel.php(96): Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
  #20 /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/api.php(23): Civi\API\Kernel->run("setting", "getfields", (Array:2), NULL)
  #21 /Users/rota/Sites/drupal/sites/all/modules/civicrm/api/api.php(43): civicrm_api("setting", "getfields", (Array:2))
  #22 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(591): civicrm_api3("setting", "getfields", (Array:2))
  #23 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/BAO/Setting.php(382): CRM_Core_BAO_Setting::validateSettingsInput((Array:1), (Array:0))
  #24 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(558): CRM_Core_BAO_Setting::setItem("B8kFl", "CiviCRM Preferences", "resCacheCode")
  #25 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(567): CRM_Core_Resources->setCacheCode("B8kFl")
  #26 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(144): CRM_Core_Resources->resetCacheCode()
  #27 /Users/rota/Sites/drupal/sites/all/modules/civicrm/CRM/Core/Resources.php(122): CRM_Core_Resources->__construct(Object(CRM_Extension_Mapper), Object(CRM_Utils_Cache_SqlGroup), "resCacheCode")
  #28 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(48): CRM_Core_Resources::singleton()
  #29 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(223): civicrm_html_head()
  #30 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(103): civicrm_initialize()
  #31 [internal function](): civicrm_menu()
  #32 /Users/rota/Sites/drupal/includes/menu.inc(2812): call_user_func("civicrm_menu")
  #33 /Users/rota/Sites/drupal/includes/menu.inc(2775): menu_router_build()
  #34 /Users/rota/Sites/drupal/sites/all/modules/civicrm/drupal/civicrm.module(788): menu_rebuild()
  #35 [internal function](): civicrm_enable()
  #36 /Users/rota/Sites/drupal/includes/module.inc(905): call_user_func_array("civicrm_enable", (Array:0))
  #37 /Users/rota/Sites/drupal/includes/module.inc(484): module_invoke("civicrm", "enable")
  #38 /Users/rota/Sites/drupal/sites/all/modules/civicrm/install/index.php(1330): module_enable((Array:2))
  #39 /Users/rota/Sites/drupal/sites/all/modules/civicrm/install/index.php(271): Installer->install((Array:5))
  #40 {main}
  ```
  
  **Tags:** drupal, mysql, installation, 4.6.10
  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_6 on 2016-08-18. Score: 3 | Accepted answer
  
  Another solution is to upgrade at least to CiviCRM 4.6.16 or to CiviCRM 4.7.7 or you can also patch your installation.
  
  If you are familair with patches you can also download a patch from the civi site. <https://github.com/civicrm/civicrm-core/commit/3f7df5902facad68489e225b504a887c2b45eb91.diff> and then apply that patch to your civicrm installation.
  
  > **Comments:**
  > **username_0**: Thank you username_6. Users can either patch older civi or use the versions you named if they need MySQL >= 5.7. Good news!  
  > **username_7**: Had this problem migrating an older site to a new server with MySQL 5.7. Thanks for posting the fix!  
  
  ---
  
  ### Answer by username_1 on 2016-03-16. Score: 4
  
  Here's a patch that seems to address the issue, although there could still be compatibility issues in the PEAR mysql and mysqli library versions used by CiviCRM.
  
  This patch is for CiviCRM 4.7.4:
  
  ```
  diff --git a/civicrm/CRM/Core/Lock.php b/civicrm/CRM/Core/Lock.php
  index b594e0b..4643fc4 100644
  --- a/civicrm/CRM/Core/Lock.php
  +++ b/civicrm/CRM/Core/Lock.php
  @@ -121,6 +121,9 @@ class CRM_Core_Lock implements \Civi\Core\Lock\LockInterface {
       else {
         $this->_name = $database . '.' . $domainID . '.' . $name;
       }
  +    if (strlen($this->_name) > 64) {
  +      $this->_name = sha1( $this->_name );
  +    }
       if (defined('CIVICRM_LOCK_DEBUG')) {
         CRM_Core_Error::debug_log_message('trying to construct lock for ' . $this->_name);
       }
  
  ```
  
  > **Comments:**
  > **username_2**: this looks good to me, what implications might there be of changing the names ? are these only temporary tables ?  
  
  ---
  
  ### Answer by username_0 on 2015-12-07. Score: 2
  
  Solution, don't upgrade to MySQL 5.7.x until this incompatibility is addressed:
  
  > The MDL subsystem imposes a limit of 64 characters on lock names, so
  > this limit now also applies to named locks. Previously, no length
  > limit was enforced.
  
  [MySql 5.7 Reference Manual, 2.11.1.1 Changes Affecting Upgrades to MySQL 5.7](https://dev.mysql.com/doc/refman/5.7/en/upgrading-from-previous-series.html#upgrade-sql-changes)
  
  > **Comments:**
  > **username_3**: Well... that's bittersweet. Sounds like MySQL 5.7 is two steps forward (enabling processes to hold multiple locks) and one step back (limiting the name length). If we could ditch MySQL <=5.6, then one could rewrite `CRM_Core_Lock` to be cleaner and more correct. Alas, we'll have to support both...  
  > **username_3**: You might be able to work-around by putting this in civicrm.settings.php; define('CIVICRM_CACHE_LOCK', 'CRM_Core_Lock::createGlobalLock'); define('CIVICRM_DATA_LOCK', 'CRM_Core_Lock::createGlobalLock'); define('CIVICRM_WORK_LOCK', 'CRM_Core_Lock::createGlobalLock');  
  
  ---
  
  ### Answer by username_4 on 2015-12-01. Score: 0
  
  You should get a full error message if you turn on debugging go to
  
  Administer menu > System Settings > Debugging and Error Handling, select "Yes" to both "Enable Debugging" and "Display Backtrace", and press "Save"
  
  and then re-try
  
  > **Comments:**
  > **username_0**: Thanks for the suggestion. I can't get to any civicrm pages.  
  > **username_0**: I edited the problem description.  
  
  ---
  
  ### Answer by username_5 on 2015-12-01. Score: 0
  
  Check once after deleting the templates\_c folder (temporary).
  
  ../files/civicrm/templates\_c/
  
  > **Comments:**
  > **username_0**: Thanks for the suggestion. Deleting civi's templates_c folder didn't fix this.  
  > **username_5**: Can please check civicrm.settings. php file for database configuration. Also browser console log.  
  > **username_5**: Also can you paste here the civicrm config log errors.  
  > **username_0**: Pasted backtrace at end of question.  
  
  ---
  
  