I have [mysqld] collation-server = latin1_german1_ci in my /etc/mysql/my.cnf, but mysql ignores this: mysql> show variables like '%colla%'; +----------------------+-------------------+ | Variable_name | Value | +----------------------+-------------------+ | collation_connection | latin1_swedish_ci | | collation_database | latin1_swedish_ci | | collation_server | latin1_swedish_ci | +----------------------+-------------------+ 3 rows in set (0.00 sec) If I edit /etc/init.d/mysql and add --collation-server = latin1_german1_ci as command line parameter, everything is fine: mysql> show variables like '%colla%'; +----------------------+-------------------+ | Variable_name | Value | +----------------------+-------------------+ | collation_connection | latin1_swedish_ci | | collation_database | latin1_german1_ci | | collation_server | latin1_german1_ci | +----------------------+-------------------+ 3 rows in set (0.00 sec) Reproducible: Always Steps to Reproduce: 1. echo dev-db/mysql ~amd64 >> /etc/portage/package.keywords 2. emerge mysql 3. Expected Results: mysql should read the collation from my.cnd
This problem still exists with mysql-5.0.16-r3
very strange, the rc script that start mysql-5.0.16-r3 read itself the parameters from /etc/mysql/my.cnf and pass them to the server. 1) See if there are differences between /usr/portage/dev-db/mysql/files/mysql-slot.rc6 and /etc/init.d/mysql 2) attach here your my.cnf file
Created attachment 73674 [details] my.cnf /usr/portage/dev-db/mysql/files/mysql-slot.rc6 and /etc/init.d/mysql are the same. I just have checked this with diff. I have attached my my.cnf
Isolated: This one fail to set the collation: #/usr/sbin/mysqld [...] \ --collation-server=latin1_german1_ci \ --default-character-set=latin1 \ --character-set-server=latin1 this one succed: #/usr/sbin/mysqld [...] \ --default-character-set=latin1 \ --character-set-server=latin1 \ --collation-server=latin1_german1_ci As you can see the order of the parameters differ. [random thoughts from here] probably setting the charset set also a default collation, since the order of parameters is "rightmost win" the collation is overrided from the charset default. (RightMost on command line corresponds to bottommost in my.cnf) workaround put all collation% settings after char% settings. May be nice from you to fill a bug upstream and see theyr thoughts (if you do so please report bug number here) Thanks for your patience. Francesco R.
I have reported this bug on http://bugs.mysql.com/15276
Created attachment 73783 [details, diff] /tmp/char-before_mysql-slot.rc6.patch patch for /etc/init.d/mysql to pass characther parameters before each other (so including collations). This may or may not be included in portage tree, still some research to do on it. basically: - is charset* the only one that need an order ? - interaction with /etc/conf.d/mysql file
> - is charset* the only one that need an order ? Currently nothing is documented about an order of parameters. At http://bugs.mysql.com/15276 it's being discussed if this should be fixed in code or documented. I really hope they fix their code.
the /etc/init.d/mysql script attached at bug #114621 should workaround this issue. Depending on feedback, it may reach production very soon.