Forums

Error backing up MYSQL database

I'm using mySql in a web2py application.

Using the instructions here: https://help.pythonanywhere.com/pages/MySQLBackupRestore/

I'm trying to backup a mysql database using this command (I've replaced actual user name and database name with usrname and dbnam below):

mysqldump -u usrnam -h usrnam.mysql.pythonanywhere-services.com --set-gtid-purged=OFF --no-tablespaces 'usrnam$dbnam'  > db-backup.sql

I'm getting this error:

mysqldump: Couldn't execute 'SELECT COLUMN_NAME, JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"') FROM information_schema.COLUM N_STATISTICS WHERE SCHEMA_NAME = 'usrnam$dbnam' AND TABLE_NAME = 'auth_cas';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)

Try using the --column-statistics=0, which is also mentioned on that page.

Thanks. That worked. Much appreciated.

Glad to hear that!