DAB MySQL deprecated --default-character-set fix

apmuthu

Renowned Member
Feb 26, 2009
871
12
83
Chennai - India & Singapore
github.com
For those building OpenVZ Templates with DAB and MySQL an analysis of the logs for MySQL v5.1+ will show:
The syntax '--default-character-set' is deprecated and will be removed in a future release. Please use --character-set-server instead.
http://bugs.mysql.com/bug.php?id=52047 lists the fix and and the CLI fix as well.

The Suggested fix and it's drawback:
I went to the config file "my.ini"
commented out: default-character-set=utf8
and added: character-set-server=utf8
rebooted

This fixed the warning - its gone.

BUT
now i can not connect via commandline:
c:\>mysql -uroot -p
enter password ****
Unknown Variable: character-set-server
c:\>

Adding the following too was okay:
added to [mysqld]
collation-server=utf8_general_ci
The real fix it seems is:
Apply the character-set-server=utf8 only in [mysqld] section and not in the [mysql] section of my.ini

The problem is fixed in MySQL v5.5 with a default install having in it's my.ini:
Code:
[mysql]...
default-character-set=utf8

[mysqld]...
character-set-server=utf8

Hope a future DAB may take this into account if there is anything it has to do with it.

View attachment MySQL Deprecated default-character-set Fix.pdf
 
Last edited: