mysqlÊý¾ÝÂÒÂëÎÊÌâÔÒò¼°½â¾ö£¨×ܽáƪ£©
mysqlÊý¾ÝÂÒÂëÎÊÌâÔÒò¼°½â¾ö£¨×ܽáƪ£©
µÚÒ»½â¾ö·½·¨£º
ÂÒÂëÎÊÌâ¼òµ¥Ëµ¾ÍÊÇÊý¾Ý¿âдÈë¶ÁÈ¡£¬ÍøÒ³Îļþ£¬ÍøÒ³ÏÔʾʱ¼¸¸ö»·½ÚµÄ±àÂë²»Ò»ÖÂÔì³ÉµÄ¡£
ÂÒÂëÎÊÌâ
дÈëʱ£ºÒ³ÃæÌáȡдÈëÊý¾Ý±àÂëºÍдÈëÊý¾Ý¿âʱ±àÂë²»Ò»ÖÂ
¶Áȡʱ£º¶ÁÈ¡ºóËùÓñàÂëÓëÊý¾Ý¿âдÈëʱ²»Ò»ÖÂ
ÏÔʾʱ£º±àÂëÓëÊý¾Ý¿â¶ÁÈ¡ºóµÄÊý¾Ý²»Ò»ÖÂ
ºÜÏÔȻֻÓÐÈýÕ߶¼Í³Ò»²ÅÐУº£¨ÒÔutf-8ΪÀý£©
1£ºÒ³ÃæÌá½»Êý¾Ý±àÂëutf-8£¨ÕâÒ²¿ÉÒÔËãÊÇÏÔʾҳÃæ±àÂ룩£¬
2£ºÊý¾Ý¿âдÈëʱ±àÂ룺alter database db default character set ‘utf8’collate ‘utf8-general-ci’£¬
3£ºÊý¾Ý¿â¶ÁȡʱËùÓñàÂ룺mysql_query£¨“set names ‘utf8’”£©£»
4£ºÏÔʾҳÃæ±àÂ룺<meta http-equiv="Content-type"content=“text/html, charset=utf-8”>
µÚ¶þ½â¾ö·½·¨£º
½øÈëMYSQLÃüÁîÐÐ:
mysql> alter database you_dbname default character set 'utf8';
mysql> SET character_set_client='utf8';
mysql> SET character_set_connection='utf8'
mysql> SET character_set_results='utf8'
µÚÈý½â¾ö·½·¨£º
£¨ÔÝʱֻÕë¶ÔMySQL 5.0.16 ÂÒÂëÎÊÌâ´¦Àí°ì·¨£¬ÆäËû°æ±¾Î´²âÊÔ¡££©
1 ÉèÖÃphpMyAdmin
¡¡¡¡Language£ºChinese simplified (zh-utf-8)
¡¡¡¡MySQL ×Ö·û¼¯£ºUTF-8 Unicode (utf8)
¡¡¡¡MySQL Á¬½ÓУ¶Ô£ºgbk_chinese_ci
2 ´´½¨Êý¾Ý¿âʱ
¡¡¡¡ÕûÀíÉèÖÃ³É gbk_chinese_ci
3 ÓÃSQL½¨Á¢±íÖÐ
¡¡¡¡ENGINE=MyISAM DEFAULT CHARSET=gbk;
¡¡¡¡ENGINE=InnoDB DEFAULT CHARSET=gbk AUTO_INCREMENT=40 ;
4 ¼ì²é±í½á¹¹ÖÐ
¡¡¡¡varchar(100) µÄÕûÀíÊôÐÔΪgbk_chinese_ci
¡¡¡¡ÆäËüÀàÐ͵ÄÕûÀíÊôÐÔΪ¿Õ
5 ´úÂëÖмÓÉÏ
¡¡¡¡$db->query("SET CHARACTER SET GBK"); ¡¡LinuxÏÂÐèÒª£¬Windowsϲ»ÐèÒª
¡¡¡¡Õâ¸öÏ൱ÓÚConnection Character Sets and Collations
ÒÔÉÏÊǸöÈË´ÓÍøÉÏËÑË÷µÄһЩ×ܽáºÍ¹éÄÉ£¬ÏàÐÅÕâ¸öÓ¦¸ÃÄܽâ¾öËùÓÐÂÒÂëµÄÎÊÌâÁË¡£
±¾ÎIJ¿·ÖÄÚÈÝתÔØ×Ôphp100.com£¬ÈçÓÐÎÊÌ⣬ÇëÓë±¾ÈËÁªÏµ¡£
Ïà¹ØÎĵµ£º
ÍíÉÏÓÐÅóÓÑÎÊÆ𣬼òµ¥µÄдÁËÒ»¸ö¡£
DELIMITER $$
CREATE
FUNCTION `t_girl`
.
`func_rand_string`
(
f_num tinyint
unsigned
,
f_type tinyint
unsigned
)
RETURNS varchar
(
32)
BEGIN
......
ÓÉÓÚ°²×°MySQLµÄʱºò£¬ÊèºöûÓÐÑ¡Ôñµ×²ã±àÂ뷽ʽ£¬²ÉÓÃĬÈϵÄASCIIµÄ±àÂë¸ñʽ£¬ÓÚÊǽӶþÁ¬ÈýµÄÖÐÎÄת»»ÎÊÌâËæÖ®¶øÀ´£¬¾ÍÏëжÔØÁËÖØа²×°MYSQL£¬ÕâһжÔص¹ÊdzöÁËÎÊÌ⣬µ¼Ö°²×°µÄʱºò°²×°²»ÉÏ£¬ÔÚÍøÉÏÕÒÁËÒ»¸ö¶àСʱҲû½â¾ö¡£
ÖØװϵͳÓÀÔ¶ÊǸöºÃ°ì·¨£¬µ«ÓÐËϲ»¶Õâô×öѽ:(
ºóÀ´ÎÞÒâ·¢ÏÖÊÇжÔصÄʱºòûÓÐжÔØÍêÈ«µ¼Ö£ ......
ÍêÈ«°²×°°ü
http://mysql.isu.edu.tw/Downloads/MySQL-5.1/mysql-5.1.38-win32.msi
°üº¬ÁË°²×°MySQLËùÐèÒªµÄÈ«²¿ÎļþÓëÅäÖÃÏòµ¼ÒÔ¼°¿ÉÑ¡×é¼þ£¬Èç»ù×¼Ì×¼þºÍǶÈëʽ·þÎñÆ÷
»ù±¾°²×°°ü
http://mysql.isu.edu.tw/Downloads/MySQL-5.1/mysql-essential-5.1.38-win32.msi
Ö»°üº¬ÁË°²×°MySQLËùÐèÒªµÄ»ù±¾ÎļþÓëÅäÖÃÏòµ¼£¬µ«ÊÇ ......
MYSQLÍü¼ÇROOTÃÜÂëºó£¿
ÐÞ¸ÄMySQLµÄµÇ¼ÉèÖãº
1.È¡ÏûȨÏÞ¹ÜÀí
±à¼ /mysql5.1/my.ini
ÔÚ[mysqld]µÄ¶ÎÖмÓÉÏÒ»¾ä£ºskip-grant-tables
ÀýÈ磺
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
skip-name-resolve
skip-grant-tables
Ä¿µÄÊÇΪÁË£º
Ìø¹ýMySQLµÄ·ÃÎ ......