Summary: | [mysql] new default character set | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Francesco R. (RETIRED) <vivo> |
Component: | Current packages | Assignee: | Gentoo Linux MySQL bugs team <mysql-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | CC: | radek, stian, tradergt |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Francesco R. (RETIRED)
2004-12-09 01:53:12 UTC
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) |