Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

½â¾ö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


Ïà¹ØÎĵµ£º

ÔÚÒ»µçÄÔÉÏ°²×°¶àmysqlʵÀý

ÎҵĻ·¾³£º
Ô­ÓÐÒ»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 ......

jdbcÁ¬½ÓmysqlÊý¾Ý¿â

ÏÈÏÂÔØÒ»¸ö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 ......

mysql²éѯ»º´æµÄÄÚ´æËéƬ

query_cache_min_res_unit   ²éѯ»º´æ·ÖÅäµÄ×îС¿éµÄ´óС(×Ö½Ú)
query_alloc_block_size    Ϊ²éѯ·ÖÎöºÍÖ´Ðйý³ÌÖд´½¨µÄ¶ÔÏó·ÖÅäµÄÄÚ´æ¿é´óС
Qcache_free_blocks´ú±íÄÚ´æ×ÔÓÉ¿éµÄ¶àÉÙ£¬·´Ó³ÁËÄÚ´æËéƬµÄÇé¿ö
==========================
1£©µ±²éѯ½øÐеÄʱºò£¬Mysql°Ñ²éѯ½á¹û±£´æÔÚqurey ......

С̸MySQL×Ö·û¼¯


×÷/ÒëÕߣºÒ¶½ðÈÙ£¨Email: £©£¬À´Ô´£ºhttp://imysql.cn£¬×ªÔØÇë×¢Ã÷×÷/ÒëÕߺͳö´¦£¬²¢ÇÒ²»ÄÜÓÃÓÚÉÌÒµÓÃ;£¬Î¥Õ߱ؾ¿¡£
Ê×ÏÈ,ÕâƬÎÄÕ´¿´âÊÇÎҵĸöÈ˾­Ñé̸֮,ÊÊÓÃÓÚÎÒ³£¼ûµÄ»·¾³¼°ÏîÄ¿ÖÐ.
¸öÈ˽¨Òé,Êý¾Ý¿â×Ö·û¼¯¾¡Á¿Ê¹ÓÃutf8(HTMLÒ³Ãæ¶ÔÓ¦µÄÊÇutf-8),ÒÔʹÄãµÄÊý¾ÝÄܺÜ˳ÀûµÄʵÏÖǨÒÆ,ÒòΪutf8×Ö·û¼¯ÊÇÄ¿Ç°×îÊʺÏÓÚÊ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ