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)
- 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 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"