Skip to content

Instantly share code, notes, and snippets.

@Kaapiii
Created August 4, 2020 13:33
Show Gist options
  • Save Kaapiii/95245565a509c72bea2a7d0f794b15d9 to your computer and use it in GitHub Desktop.
Save Kaapiii/95245565a509c72bea2a7d0f794b15d9 to your computer and use it in GitHub Desktop.
PHPStorm mysqldump throws errors while dumping a database on MySQL server version >= 5.7.31

Fix errors while executing mysqldump (with PhpStorm) on a database running on MySQL 5.7.31 and above.

(Dump worked seamlessly with mysql version 5.7.30)

Errors

  • mysqldump: Error: 'Access denied; you need (at least one of) the PROCESS privilege(s) for this operation' when trying to dump tablespaces
  • mysqldump: Couldn't execute 'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"') FROM information_schema.COLUMN_STATISTICS WHERE SCHEMA_NAME = 'concrete5com' AND TABLE_NAME = 'AreaLayoutColumns';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)

Fix

Fix the errors by adding the two following flags to the mysqldump command in PhpStorm

--no-tablespaces
--column-statistics=0

The command should look like this:

"mydatabase" --skip-add-locks --skip-lock-tables --no-tablespaces --column-statistics=0 --result-file="/home/myuser/db_dumps/{data_source}_{database}_{timestamp}.sql"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment