GRANT LOCK TABLES missing from INSTALL.mysql.txt and required for database migration

Created on 12 May 2015, over 10 years ago
Updated 11 August 2025, 12 days ago

Problem/Motivation

After following the Drupal 7.x installation steps, provided in INSTALL.mysql.txt for Drupal 7.3.7 and the Drupal Handbook Step 2: Create the database β†’ , I was later unable to perform a database migration because Drupal did not have a MySQL LOCK TABLES privilege for the database.

Steps to Reproduce

I am running the following Operating System and web application stack:

  • Centos 6.6
  • Apache 2.2.15
  • PHP 5.3.3
  • MySQL 5.1.61
  • Drupal 7.3.7
  • Drush 6.6.0

Follow these steps to reproduce the problem.

  1. Download Drupal 7.x
  2. Create the MySQL database for Drupal 7.x by following the Drupal 7.3.7 INSTALL.mysql.txt steps. Specifically, use the MySQL database permissions outlined as
    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER,
      CREATE TEMPORARY TABLES ON databasename.*
      TO 'username'@'localhost' IDENTIFIED BY 'password';
  3. Run the Drupal 7.x install script
  4. Follow the remaining Drupal 7.3.7 INSTALL.txt steps
  5. Install drush 6.6.0
  6. From the Drupal root folder attempt to migrate an existing Drupal MySQL database from another site - ie. drush sql-sync @remote.source @self

These steps result in a failure, which can be tracked down to the first line from the database dump that includes a MySQL LOCK TABLES statement. Most mysqldump output will include MySQL LOCK TABLES statements, including those created by drush sql-sync using a default set-up.

Proposed resolution

Add the GRANT LOCK TABLES permission to the MySQL installation documentation. Add it as a suggested permission if need be. System Administrators and Developers wanting to migrate databases require this permission on MySQL database tables at a minimum and the drush sql-sync command fails without it.

Is there a strong case why this should not be included as a minimum? If so, lets debate them here and find a way forward so that Drupal installation, deployment and migration is predictable and painless for everyone.

Remaining tasks

Update the Drupal Handbook Step 2: Create the database β†’ to match whatever is added to the Drupal 7.x INSTALL.mysql.txt.

πŸ“Œ Task
Status

Postponed: needs info

Version

11.0 πŸ”₯

Component

database system

Created by

πŸ‡¦πŸ‡ΊAustralia chop

Live updates comments and jobs are added and updated live.
  • Documentation

    Primarily changes documentation, not code. For Drupal core issues, select the Documentation component instead of using this tag. In general, component selection is preferred over tag selection.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

Production build 0.71.5 2024