Lately MySQL AB goes to use "utf8" as default character set instead of "latin1". This change probably affect performance, basically because of the increased size (~60% more on my dbs). So the choice of use it or not should be leaved at the end user. Also as far as I know, gentoo is utf8 friendly at least in the meaning that it's moving to adopt and support it widely. so: What about to add a "utf8" to IUSE that remove the actual forced latin1 default? or define a variable like LINGUAS of kde Also if you chose of not support this I definetively suggest to add the following at my.cnf: [client] ... character_set = utf8 default-character-set = utf8 [mysqld] ... character-set-server = utf8 default-character-set = utf8 substitute utf8 with latin1 if you want. This because of strange behaviour that the database has when they are not forced. It threat constant string as one character set and the variable fields as another breaking all queryes with a constant in where clause. best regards francesco Reproducible: Always Steps to Reproduce:
LINGUAS deals with locales, but not character sets.
hints: 1) To make phpmyadmin work we must run a script located in phpmyadmin directory, with some substitution: s/ALTER DATABASE `phpmyadmin`/ALTER DATABASE `pmadb`/ s/pma_/PMA_/ scripts/upgrade_tables_mysql_4_1_2+.sql 2)Probably I missing something but I still have problems with php but mysql manual came in help: http://dev.mysql.com/doc/mysql/en/Charset-collation-charset.html #Illegal mix of collations SELECT DISTINCT a, CONCAT(b, ' ', b) AS this_fail FROM tabella # NOTE that _utf8 that can be _latin1 for you SELECT DISTINCT a, CONCAT(b, _utf8' ', b) AS this_not FROM tabella
Hints 2 Thanks to phpmyadmin that show to me ho to do it in a better way <html><body><pre> <?php $sql = " SELECT CONCAT(astring, ' ') AS I_am_the_problem , astring FROM tabella LIMIT 5 "; echo $sql; $lnk = mysqli_connect("localhost", "user", "password","database_name",3306,"/var/run/mysqld/mysqld.sock"); $rs = mysqli_query($lnk, 'SET NAMES utf8'); $rs = mysqli_query($lnk, 'SET CHARACTER SET utf8'); // not sure that this apply $rs = mysqli_query($lnk, 'SET collation_connection = "utf8_general_ci"'); $rs = mysqli_query($lnk, $sql); while($row = mysqli_fetch_assoc($rs)) { print_r($row); } ?> </pre></body></html>
<rant> mysqld 4.1.7 & php 5.0.2 *don't* try mysqli_multi_query($lnk, 'SET NAMES utf8; SET CHARACTER SET utf8; SET collation_connection = "utf8_general_ci";'); or it will loose the connection and probably burn your cpu and hard disks </rant>
solved for ebuilds now in the tree (using the "utf8" use flag)