Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysqldump COLUMN_STATISTICS error #2

Open
sobocinski opened this issue Feb 16, 2021 · 1 comment
Open

mysqldump COLUMN_STATISTICS error #2

sobocinski opened this issue Feb 16, 2021 · 1 comment

Comments

@sobocinski
Copy link

Hi,
when I was using sulu:export commnad I have error like this.

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

According to what is written https://serverfault.com/a/912677 This is due to a new flag that is enabled by default in mysqldump 8, adding --column-statistics=0 to mysqldump command fixes the problem.

So maybe a change in exportDatabase() method to:

$command = 
 "mysqldump --column-statistics=0 -h {$this->databaseHost} -u " . escapeshellarg($this->databaseUser) .
            ($this->databasePassword ? ' -p' . escapeshellarg($this->databasePassword) : '') .
            ' ' . escapeshellarg($this->databaseName) . ' > ' . $this->exportDirectory . \DIRECTORY_SEPARATOR . ImportExportDefaultMap::FILENAME_SQL;

will solve problems in future.

@TheCadien
Copy link
Member

Thanks @sobocinski .
I'll have a look at it, but I think you're right and this could be a good change for the future.
Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants