mysql set names ÎÊÌâ
mysql set names ÎÊÌâ
mysql_query("set names 'utf8'");
Ò»Ö±ÒÔÀ´×ÜÒÔΪset names ÊÇÓÃÀ´ÉèÖÃmsyql µÄ×Ö·û¼¯µÄ£¬×î½ü×÷¸ö¶«Î÷²Å·¢ÏÖ×Ô¼ºÈÏʶÉϵĴíÎó£¬
²éÒ»ÏÂÊÖ²á
SET NAMES ‘x‘Óï¾äÓëÕâÈý¸öÓï¾äµÈ¼Û£º
mysql> SET character_set_client = x;
mysql> SET character_set_results = x;
mysql> SET character_set_connection = x;
ÊÇÓÃÀ´ÉèÖÿͻ§¶ËµÄ×Ö·û¼¯µÄ£¬Óë·þÎñÆ÷¶ËµÄ×Ö·û¼¯Î޹أ¬Ó¦¸Ã˵msyql·þÎñÆ÷¶Ë´æ´¢µÄ×Ö·ûÊÇÒ»¶¨µÄ¡£
Òò´ËÔÚÖ»Òª±£³Öset names x ÓëÒ³ÃæµÄ±àÂëÒ»Ö ,ÎÞÂÛʲô±àÂ붼¿ÉÒÔÕýÈ·ÏÔʾ
×¢Ò⣺ÕâÀïµÄ£¬mysql setNames utf8 Not utf-8£¬¿´Çå³þÁË£»
Ïà¹ØÎĵµ£º
2009Äê10ÔÂ30ÈÕ ÐÇÆÚÎå 22:53
1, ²é¿´MySQL
·þÎñÆ÷ÅäÖÃÐÅÏ¢
mysql> show variables;
mysql> show variables;
2, ²é¿´MySQL·þÎñÆ÷ÔËÐеĸ÷ÖÖ״ֵ̬
mysql> show global status;
mysql> show global status;
3, Âý²éѯ
mysql> show variables like '%slow%';
+--------------- ......
2009Äê10ÔÂ30ÈÕ ÐÇÆÚÎå 22:53
ÓÃmysql
ÄÚÖú¯Êýת»»ipµØÖ·ºÍÊý×Ö
ÀûÓÃÁ½¸öÄÚÖú¯Êý
inet_aton:½«ipµØַת»»³ÉÊý×ÖÐÍ
inet_ntoa:½«Êý×ÖÐÍת»»³ÉipµØÖ·
³ä·ÖÀûÓÃmysqlÄÚÖõÄ
format
º¯Êý
ÓÈÆäÊÇÔÚ´¦Àí×Ö·û¸ñʽµÄʱºò,ÀýÈ罫12345ת»»³É12,345ÕâÑùµÄ,Ö»ÒªÓÃ:format(12345,0)¼´¿É,Èç¹ûÓÃformat(12345,2)ÔòÏÔÊ ......
Ä¿Ç°Óв»ÉÙAMP£¨Apache\MySQL\PHP£©µÄ¼¯³ÉÈí¼þ£¬¿ÉÒÔÈÃÎÒÃÇÒ»´Î°²×°²¢ÉèÖúá£Õâ¶ÔÓÚ²»ÊìϤAMPµÄÓû§À´Ëµ£¬ºÃ´¦¶à¶à¡£
Ò»¡¢Ê¹ÓÃAMP¼¯³ÉÈí¼þµÄÓŵ㣺
1¡¢¿É±ÜÃâÓÉÓÚȱ·¦AMPµÄ֪ʶ£¬¶øÎÞ·¨ÕýÈ·ÉèÖû·¾³£»
2¡¢¿É¿ìËÙ°²×°²¢ÉèÖúÃAMP»·¾³£¬ÈÃÎÒÃÇÖ±½Ó¿ªÊ¼ÕæÕý¸ÐÐËȤµÄÈí¼þ£¬Èçxoops£»
3¡¢¿É·½±ãµÄ´î½¨²âÊÔ»·¾³£¬¶ÔÓÚ² ......
×î½üÉÏÍøÕÒÁËһЩ¹ØÓÚ±¸·ÝmysqlÊý¾Ý¿âµÄ·½·¨£¬Ö÷Òª¾ÍÊÇͨ¹ýÍøÒ³µÄ·½·¨µ¼³öÊý¾Ý¿âµÄsql Îļþ£¬ÕÒµ½¸ö²»´íµÄ´úÂ룬µ«·¢ÏÖÖÐÎĵ¼³ö»áÂÒÂ룬ÓÚÊÇÉÔ΢ÐÞ¸ÄÁËһϣ¬ÏÂÃæÊDZ¸·ÝµÄ´úÂë
view plaincopy to clipboardprint?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml ......
MySQLÊý¾Ý¿âµÄ¼òµ¥²Ù×÷
Ò».´´½¨Êý¾Ý¿â ͨ¹ýshow databases;ÃüÁîÏÔʾËùÓÐÒÑ´´½¨µÄÊý¾Ý¿âµÄÃû³Æ¡£
ͨ¹ýcreate database XXX;´´½¨Êý¾Ý¿âÃûΪXXXµÄÊý¾Ý¿â¡£ ÀýÈ磺mysql>create database test; ¶þ.´´½¨±íµ¥ ͨ¹ýcreate table XXX();´´½¨ ÀýÈç: È»ºó¿ÉÒÔͨ¹ýdescÃüÁî²é¿´±íµ¥: ÀýÈç: Èý ......