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

mysql×Ö·û¼¯ÉèÖúͲéѯÎÊÌ⣨ת£©

mysql×Ö·û¼¯ÉèÖúͲéѯÎÊÌ⣨ת£©
2010-04-14 11:33
MySQLµÄ×Ö·û¼¯Ö§³Ö(Character Set Support)ÓÐÁ½¸ö·½Ã棺
     ×Ö·û¼¯(Character set)ºÍÅÅÐò·½Ê½(Collation)¡£
¶ÔÓÚ×Ö·û¼¯µÄÖ§³Öϸ»¯µ½Ëĸö²ã´Î:
     ·þÎñÆ÷(server)£¬Êý¾Ý¿â(database)£¬Êý¾Ý±í(table)ºÍÁ¬½Ó(connection)¡£
1.MySQLĬÈÏ×Ö·û¼¯
MySQL¶ÔÓÚ×Ö·û¼¯µÄÖ¸¶¨¿ÉÒÔϸ»¯µ½Ò»¸öÊý¾Ý¿â£¬Ò»ÕÅ±í£¬Ò»ÁУ¬Ó¦¸ÃÓÃʲô×Ö·û¼¯¡£
µ«ÊÇ£¬´«Í³µÄ³ÌÐòÔÚ´´½¨Êý¾Ý¿âºÍÊý¾Ý±íʱ²¢Ã»ÓÐʹÓÃÄÇô¸´ÔÓµÄÅäÖã¬ËüÃÇÓõÄÊÇĬÈϵÄÅäÖã¬ÄÇô£¬Ä¬ÈϵÄÅäÖôӺζøÀ´ÄØ£¿
    (1)±àÒëMySQL ʱ£¬Ö¸¶¨ÁËÒ»¸öĬÈϵÄ×Ö·û¼¯£¬Õâ¸ö×Ö·û¼¯ÊÇ latin1£»
    (2)°²×°MySQL ʱ£¬¿ÉÒÔÔÚÅäÖÃÎļþ (my.ini) ÖÐÖ¸¶¨Ò»¸öĬÈϵĵÄ×Ö·û¼¯£¬Èç¹ûûָ¶¨£¬Õâ¸öÖµ¼Ì³Ð×Ô±àÒëʱָ¶¨µÄ£»
    (3)Æô¶¯mysqld ʱ£¬¿ÉÒÔÔÚÃüÁîÐвÎÊýÖÐÖ¸¶¨Ò»¸öĬÈϵĵÄ×Ö·û¼¯£¬Èç¹ûûָ¶¨£¬Õâ¸öÖµ¼Ì³Ð×ÔÅäÖÃÎļþÖеÄÅäÖÃ,´Ëʱ character_set_server ±»É趨ΪÕâ¸öĬÈϵÄ×Ö·û¼¯£»
    (4)µ±´´½¨Ò»¸öеÄÊý¾Ý¿âʱ£¬³ý·ÇÃ÷È·Ö¸¶¨£¬Õâ¸öÊý¾Ý¿âµÄ×Ö·û¼¯±»È±Ê¡É趨Ϊcharacter_set_server£»
    (5)µ±Ñ¡¶¨ÁËÒ»¸öÊý¾Ý¿âʱ£¬character_set_database ±»É趨ΪÕâ¸öÊý¾Ý¿âĬÈϵÄ×Ö·û¼¯£»
    (6)ÔÚÕâ¸öÊý¾Ý¿âÀï´´½¨Ò»Õűíʱ£¬±íĬÈϵÄ×Ö·û¼¯±»É趨Ϊ character_set_database£¬Ò²¾ÍÊÇÕâ¸öÊý¾Ý¿âĬÈϵÄ×Ö·û¼¯£»
    (7)µ±ÔÚ±íÄÚÉèÖÃÒ»À¸Ê±£¬³ý·ÇÃ÷È·Ö¸¶¨£¬·ñÔò´ËÀ¸È±Ê¡µÄ×Ö·û¼¯¾ÍÊDZíĬÈϵÄ×Ö·û¼¯£»
¼òµ¥µÄ×ܽáһϣ¬Èç¹ûʲôµØ·½¶¼²»Ð޸ģ¬ÄÇôËùÓеÄÊý¾Ý¿âµÄËùÓбíµÄËùÓÐÀ¸Î»µÄ¶¼Óà latin1 ´æ´¢£¬²»¹ýÎÒÃÇÈç¹û°²×° MySQL£¬Ò»°ã¶¼»áÑ¡Ôñ¶àÓïÑÔÖ§³Ö£¬Ò²¾ÍÊÇ˵£¬°²×°³ÌÐò»á×Ô¶¯ÔÚÅäÖÃÎļþÖÐ°Ñ default_character_set ÉèÖÃΪ UTF-8£¬Õâ±£Ö¤ÁËȱʡÇé¿öÏ£¬ËùÓеÄÊý¾Ý¿âµÄËùÓбíµÄËùÓÐÀ¸Î»µÄ¶¼Óà UTF-8 ´æ´¢¡£
2.²é¿´Ä¬ÈÏ×Ö·û¼¯(ĬÈÏÇé¿öÏ£¬mysqlµÄ×Ö·û¼¯ÊÇlatin1(ISO_8859_1)
ͨ³££¬²é¿´ÏµÍ³µÄ×Ö·û¼¯ºÍÅÅÐò·½Ê½µÄÉ趨¿ÉÒÔͨ¹ýÏÂÃæµÄÁ½ÌõÃüÁ
     mysql> SHOW VARIABLES LIKE 'character%';
+--------------------------+---------------------------------+
| Variable_name            | Value   &nbs


Ïà¹ØÎĵµ£º

MYSQL[ÃüÁîÐÐÏÂ]µ¼Èëµ¼³ö´óÊý¾Ý·½·¨£¡


2007-11-16 15:37
½ñÌì¿´×ÅÊÖ²áÊÔÁËÏ£¬·¢ÏÖÔ­À´´óÊý¾Ýµ¼Èëµ¼³öÊÇÄÇôµÄÇáËÉ£¨²»ÊǺܴó£¬200¶àMµÄÎı¾¶øÒÔ£©
×¢Ò⣺Èç¹û·¢ÏÖMYSQL unknown command '\'ÕâÑùµÄÌáʾ£¬ÔòÉèÖÃһϷþÎñÆ÷µÄ×Ö·û¼¯£¬È磺
mysql -uroot -ppasspass --default-character-set=utf8 databaseName <d:bakcup.sql
ÕâÑù¾Í²»»á±¨´íÁË£¬^_^
µ¼³ö ......

mysql ÐÞ¸ÄÃÜÂë

use mysql
update user set Password=password('newpassword') where User='root';
flush privileges;
Ê×ÏÈÒªÉùÃ÷Ò»µã£¬´ó²¿·ÖÇé¿öÏ£¬ÐÞ¸ÄMySQLÊÇÐèÒªÓÐmysqlÀïµÄrootȨÏ޵ģ¬
ËùÒÔÒ»°ãÓû§ÎÞ·¨¸ü¸ÄÃÜÂ룬³ý·ÇÇëÇó¹ÜÀíÔ±¡£
·½·¨Ò»
ʹÓÃphpmyadmin£¬ÕâÊÇ×î¼òµ¥µÄÁË£¬ÐÞ¸Ämysql¿âµ ......

´ò¿ªmysqlÔ¶³Ì·ÃÎÊȨÏÞ


2009-05-05
´ò¿ªMySQLÔ¶³Ì·ÃÎÊȨÏÞ
¹Ø¼ü×Ö: mysql
1¡¢¸Ä±í·¨
¡¡¡¡¿ÉÄÜÊÇÄãµÄÕʺŲ»ÔÊÐí´ÓÔ¶³ÌµÇ½£¬Ö»ÄÜÔÚlocalhost¡£Õâ¸öʱºòÖ»ÒªÔÚlocalhostµÄÄÇ̨µçÄÔ£¬µÇÈëmysqlºó£¬¸ü¸Ä "mysql" Êý¾Ý¿âÀïµÄ "user" ±íÀïµÄ "host" Ï´Ó"localhost"¸Ä³Æ"%"
¡¡¡¡mysql -u root -p
mysql>use mysql;
¡¡¡¡mysql>upda ......

MySql±àÂëÎÊÌâ

      ÎÒͬѧ½ÓÁ˸ö˽»î£¬ÏòÎÒÒªÁËmysqlµÄ°²×°Îļþ¡£×òÍíËûÎÊÎÒÓÐûÓöµ½mysqlµÄÂÒÂëÎÊÌ⣬ÎÒ¸øËûµÄ´ð°¸ÊǵÚÒ»´ÎÓõÄʱºòÓöµ½¹ý£¬ÅäºÃÁ˺ó£¬ÏÖÔÚ¶¼Ã»ÓÐÁË¡£Ëû˵ÔÚÍøÉÏÕÒÁ˺ܶàÎÄÕ£¬ÕÕןÄÁËËùÓÐÅäÖÃÎļþ¶¼Ã»½â¾ö¡£
      ÏëÏëÒ²ÊÇ£¬µ±³õµÚÒ»´ÎÓõÄʱºòÒ²ÊÇÒ»Ñù£¬¸ÄÁËËù ......

mysql ½¨Á¢Ë÷Òý

¾ÍÏóÐí¶àµÄPHP¿ª·¢ÕßÒ»Ñù£¬ÔÚ¸Õ¿ªÊ¼½¨Á¢¶¯Ì¬ÍøÕ¾µÄʱºò£¬ÎÒ¶¼ÊÇʹÓÃÏà¶Ô¼òµ¥
µÄÊý¾Ý½á¹¹¡£PHPÔÚÁ¬½ÓÊý¾Ý¿â·½ÃæµÄȷʵÊÇÊ®·Ö·½±ã£¨ÒëÕß×¢£ºÓÐЩÈËÈÏΪPHPÔÚÁ¬½Ó²»Í¬Êý¾Ý¿âʱûÓÐÒ»¸öͳһµÄ½Ó¿Ú£¬²»Ì«·½±ã£¬ÆäʵÕâ¿ÉÒÔͨ¹ýһЩÀ©
Õ¹¿âÀ´×öµ½ÕâÒ»µã£©£¬ÄãÎÞÐè¿´´óÁ¿µÄÉè¼ÆÎĵµ¾Í¿ÉÒÔ½¨Á¢ºÍʹÓÃÊý¾Ý¿â£¬ÕâÒ²ÊÇPHP»ñµÃ³É¹¦µÄÖ÷ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ