½â¾ömysqlÖÐÎÄÂÒÂëÎÊÌâ
1¡¢´ò¿ªÎı¾±à¼my.cnf
sudo gedit /etc/mysql/my.cnf
ÔÚ[client]
½Úµã£¬Ìí¼Ó
default-character-set=utf8 (¿Í»§¶ËȱʡÒÔutf8´æ´¢)
ÔÚ[mysqld]
½Úµã£¬Ìí¼Ó
default-character-set=utf8 (Êý¾Ý¿âȱʡÒÔutf8´æ´¢)
init_connect='SET NAMES utf8'
£¨É趨Á¬½ÓmysqlÊý¾Ý¿âʱʹÓÃutf8±àÂ룬ÒÔÈÃmysqlÊý¾Ý¿âΪutf8ÔËÐУ©
±£´æ£¬¹Ø±Õ
2¡¢ÖØÆômysql
Í£Óãº
sudo mysqladmin shutdown -u root -p
ÆôÓãº
sudo mysqld_safe -user=mysql &
3¡¢²é¿´mysql±àÂë
sudo mysql -u root -p
mysql>show variables like 'character%';
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 &nb
Ïà¹ØÎĵµ£º
ÎҵĻ·¾³£º
ÔÓÐÒ»mysql5.0ʵÀý£¬ÏÖа²×°Ò»mysql5.1£¬²¢½«ÐµÄ5.1ʵÀýµÄÊý¾Ý·¾¶·ÅÔÚÁíһĿ¼¡£
mysql5.1µÄmy.iniÈçÏÂ
£¨ÅäÖÃmy.iniµÄ²Î¿¼×ÊÁÏ£º
http://dev.mysql.com/doc/refman/5.1/en/option-files.html
http://downloads.mysql.com/docs/mysql-windows-excerpt-5.1-en.pdf
http://dev.mysql.com/doc/refman/5.0 ......
ÏÈÏÂÔØÒ»¸ömysqlµÄÇý¶¯Æ÷£º£¨ÎÒϵÄÊÇmysql-connector-java-3.1.11-bin.jar£©
½«Ëü·Åµ½java\libĿ¼ÏÂ
ÔÚ»·¾³±äÁ¿µÄCLASSPATHÀïÌí¼Ó¸ÃÀࣨ%JAV_HOMG%\lib\mysql-connector-java-3.1.11-bin.jar)
³ö²âÊԸöδúÂë¼´¿É£º
import java.net.URL;
import java.sql.*;
public class sqlTest {
public static void mai ......
query_cache_min_res_unit ²éѯ»º´æ·ÖÅäµÄ×îС¿éµÄ´óС(×Ö½Ú)
query_alloc_block_size Ϊ²éѯ·ÖÎöºÍÖ´Ðйý³ÌÖд´½¨µÄ¶ÔÏó·ÖÅäµÄÄÚ´æ¿é´óС
Qcache_free_blocks´ú±íÄÚ´æ×ÔÓÉ¿éµÄ¶àÉÙ£¬·´Ó³ÁËÄÚ´æËéƬµÄÇé¿ö
==========================
1£©µ±²éѯ½øÐеÄʱºò£¬Mysql°Ñ²éѯ½á¹û±£´æÔÚqurey ......
×÷/ÒëÕߣºÒ¶½ðÈÙ£¨Email: £©£¬À´Ô´£ºhttp://imysql.cn£¬×ªÔØÇë×¢Ã÷×÷/ÒëÕߺͳö´¦£¬²¢ÇÒ²»ÄÜÓÃÓÚÉÌÒµÓÃ;£¬Î¥Õ߱ؾ¿¡£
Ê×ÏÈ,ÕâƬÎÄÕ´¿´âÊÇÎҵĸöÈ˾Ñé̸֮,ÊÊÓÃÓÚÎÒ³£¼ûµÄ»·¾³¼°ÏîÄ¿ÖÐ.
¸öÈ˽¨Òé,Êý¾Ý¿â×Ö·û¼¯¾¡Á¿Ê¹ÓÃutf8(HTMLÒ³Ãæ¶ÔÓ¦µÄÊÇutf-8),ÒÔʹÄãµÄÊý¾ÝÄܺÜ˳ÀûµÄʵÏÖǨÒÆ,ÒòΪutf8×Ö·û¼¯ÊÇÄ¿Ç°×îÊʺÏÓÚÊ ......