HiveBrain v1.2.0
Get Started
← Back to all entries
debugsqlMinor

mysqldump still fails even with mysqldump --column-statistics=0

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
failsstillwithcolumnmysqldumpstatisticseven

Problem

mysqldump still fails even when using mysqldump --column-statistics=0

# mysqldump --column-statistics=0


Just returns

# mysqldump: [ERROR] unknown variable 'column-statistics=0'


Am I missing something obvious here?

EDIT: Even trying to get the version gives me an error.

mysqldump -v
mysqldump: [ERROR] unknown variable 'column-statistics=0'


Mysql version is:

# mysql -v
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1221
Server version: 5.7.27-0ubuntu0.16.04.1-log (Ubuntu)


Which mysql:

# which mysql
/usr/bin/mysql


It's an Ubuntu server running ServerPilot. The ultimate aim is to run the SiteGround WordPress migration plugin, but it's failing with the Column Statistics error in it's log.

Also tried from the comments:

root@vultr:~# mysqldump --no-column-statistics
mysqldump: [ERROR] unknown variable 'column-statistics=0'
root@vultr:~# mysqldump --skip-column-statistics
mysqldump: [ERROR] unknown variable 'column-statistics=0'
root@vultr:~#


and then even mysqldump on it's own errors:

# mysqldump
mysqldump: [ERROR] unknown variable 'column-statistics=0'

Solution

If you are running a version of mysqldump that does not support the column-statistics argument, you need to remove the argument from the command line and config files.

I am running MariaDB 10.0.38-0ubuntu0.16.04.1 which does not support column-statistics, which were added to MySQL 8.0. I ran strace mysqldump to find which config files it accessed which were:

/etc/my.cnf (did not exist)
/etc/mysql/my.cnf (removed arg)
/etc/mysql/conf.d/mysql.cnf
/etc/mysql/conf.d/mysqldump.cnf (removed arg)
/etc/mysql/mariadb.conf.d/50-client.cnf
/etc/mysql/mariadb.conf.d/50-mysql-clients.cnf (removed arg)
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf
/etc/mysql/mariadb.conf.d/50-server.cnf (removed arg)
~/.my.cnf (did not exist)


Any of those config files that had a section like

[mysqldump]
column-statistics=0


I removed the column-statistics=0 argument. This allowed mysqldump to work again.

Code Snippets

/etc/my.cnf (did not exist)
/etc/mysql/my.cnf (removed arg)
/etc/mysql/conf.d/mysql.cnf
/etc/mysql/conf.d/mysqldump.cnf (removed arg)
/etc/mysql/mariadb.conf.d/50-client.cnf
/etc/mysql/mariadb.conf.d/50-mysql-clients.cnf (removed arg)
/etc/mysql/mariadb.conf.d/50-mysqld_safe.cnf
/etc/mysql/mariadb.conf.d/50-server.cnf (removed arg)
~/.my.cnf (did not exist)
[mysqldump]
column-statistics=0

Context

StackExchange Database Administrators Q#253485, answer score: 2

Revisions (0)

No revisions yet.