Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'unknown variable "character-set-server=utf-8"' error at mysqldump

I'm using mysql 5.5.38 at SMP Debian Linux 3.2.60.

It works fine, but I'm unable to do any backup. mysqldump always shows 'unknown variable "character-set-server=utf-8"' error. i.e.

$ mysqldump --version

unknown variable "character-set-server=utf-8"

Is there any way to fix it in my.cnf or any other way?

like image 404
Alexander Teut Avatar asked Oct 01 '14 06:10

Alexander Teut


People also ask

How do I change the default character-set-server in MySQL?

Replace character-set-server=utf8 or character-set-server=utf8, whichever you have, with default-character-set=utf8 Restart MySQL server. in your ~/.my.cnf or the system-wide my.cnf. This variable isn't recognized and causes an error, so you should remove it.

What chokes mysqldump If I don't add the loose prefix?

It is the [client] variable grouping in your config that chokes mysqldump if you don't add the "loose-" prefix to local-infile. Show activity on this post. Seems like the new version you install is compiled without support of local-infile parameter.

Is it possible to comment out a variable in MySQL?

The suggestion to comment out the variable is not an option if you want LOAD DATA INFILE functionality out of the box, and MySQL 8+ for security reasons requires you to set this variable for both server (mysqld) and client.


1 Answers

Per documentation https://dev.mysql.com/doc/refman/5.5/en/charset-applications.html ,

[mysqld]
character-set-server=utf8
collation-server=utf8_general_ci

change character-set-server=utf-8 to character-set-server=utf8 in your my.cnf file

like image 161
Kyle Avatar answered Sep 23 '22 06:09

Kyle