mysql5µÄ×Ö·û¼¯ºÍsql modeÎÊÌâ
http://hi.baidu.com/gushu/blog/item/3e821c174eabec064a90a7d4.html
mysql5Ìí¼ÓÁËһЩÐµĹ¦ÄܵĹæÔò£¬ÆäÖжԿªÔ´³ÌÐòÓ°Ïì±È½Ï´óµÄÓÐÁ½¸ö£¬Ò»¸öÊÇ4.0.12+¿ªÊ¼µÄ4²ã´Î×Ö·û¼¯£¬Ò»¸öÊÇ5.0.18¿ªÊ¼µÄĬÈÏstrict mode¡£
¶ÔÓÚÕâÁ½¸öÎÊÌ⣬ЧÂÊ×îºÃµÄ½â¾ö·½°¸£¬¾ÍÊÇÖ±½ÓÐÞ¸Ämy.ini
# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=utf8
#ÕâÀï¸Ä³Éutf-8
# Set the SQL mode to strict
sql-mode="STRICT_TRANS_TABLES£¬ NO_AUTO_CREATE_USER£¬ NO_ENGINE_SUBSTITUTION"
#ÕâÀï¸Ä³É=""
µ±ÄãûÓÐȨÏÞ½øÐÐÐÞ¸Äʱ£¬¾ÍÖ»ºÃÔÚ³ÌÐòÖÐÅжÏÁËmysql5 й¦ÄÜ£¬±ØÐëÔÚÿ´ÎÁ¬½ÓÉÏÊý¾Ý¿âʱ½øÐÐÉ趨¡£ÔÚʹÓÃÁËÊý¾Ý¿â³éÏó²ãµÄ³ÌÐòÖÐÐÞ¸ÄÆðÀ´Ò²ºÜ¼òµ¥£º
if(mysql_get_server_info( $connect ) > '4.0.1')
{
mysql_query( "set names 'utf8'" £¬ $connect );
}
if(mysql_get_server_info( $connect ) > '5.0.1')
{
mysql_query("SET sql_mode=''" £¬ $connect );
}
Ïà¹ØÎĵµ£º
½â¾ö°ì·¨£ºÔÚÁ¬½Ó×Ö·û´®ÖÐ˵Ã÷Á¬½Ó×Ö·ûµÄÊôÐÔ£¬È磺
<add name="server_mysql" connectionString="server=127.0.0.1;user id=root; password=123; database=baiduemail; pooling=false;charset=gbk"/>
»òÕßÊÇ;charset=gb2312
ÁíÍâ×¢Ò⣺ÔÚ´´½¨mysqlÊý¾Ý¿âµÄ±íµÄʱºòÑ¡Ôñ±àÂ뼯gbk ......
½ü¶Îʱ¼äͻȻ¶ÔMYSQLÕâ¸ö¿ªÔ´Êý¾ÝÓÐÁËÐËȤ£¬Ö÷ÒªÊÇÆäÊÇ¿ªÔ´Ãâ·Ñ£¬ÏëÏëÒÔºóÎÞÂÛÊǹ«Ë¾×öÏîÄ¿»¹ÊǸöÈË×öЩ¼òµ¥µÄСϵͳ£¬¶¼¿ÉÒÔÑ¡Ôñ£¬ÓÚÊÇ»¨Á˵ãʱ¼äÑо¿ÁËÏ£¬ÏÖÔÚ·ÖÏíÏÂ×Ô¼ºµÄѧϰÐĵ᣽ñÌì¿´ÁËдÆäϵͳµÄ×é³ÉºÍÕûÌå½á¹¹£¬ÏÖÔÚ°ÑÕûÌåµÄ½á¹¹ÓÃVISIO»ÁËÏ£¬È»ºóÖðÒ»½âÊÍ£¬²¢²ûÊöÏÂÎÒµÄÀí½â£¬Ï±ßÊÇMySQLϵͳ½á¹¹Í¼µ ......
Ê×ÏÈÒªÉùÃ÷һϣºÒ»°ãÇé¿öÏ£¬ÐÞ¸ÄMySQLÃÜÂ룬ÊÚȨ£¬ÊÇÐèÒªÓÐmysqlÀïµÄrootȨÏ޵ġ£
²âÊÔ»·¾³£ºWIN32 mysql5.0.45
×¢£º±¾²Ù×÷ÊÇÔÚWINÃüÁîÌáʾ·ûÏ£¬phpMyAdminͬÑùÊÊÓá£
Óû§£ºphplamp Óû§Êý¾Ý¿â£ºphplampDB
1.н¨Óû§¡£
//怬MYSQL
@>mysql -u root -p
@>ÃÜÂë
//´´½¨Óû§
mys ......
ÎÒÃǽ«ÒªÏêϸµÄ½²µ½MySQLµÄÆÊÎö(Profiling),ÒòΪËüºÜÉÙÒÀÀµÓÚÄãµÄÓ¦Óá£Ó¦ÓúͷþÎñÆ÷¼¶±ðµÄÆÊÎöÓеÄʱºò¶¼ÊÇÓбØÒªµÄ¡£ËäȻӦÓü¶±ðµÄÆÊÎö¿ÉÒÔ¸øÄãÕû¸öÓ¦ÓÃÐÔÄܵÄ×ÜÀ¿¡££¬µ«ÊǶÔMySQLµÄÆÊÎöÌṩÁËÐÅÏ¢ÊÇ·þÎñÆ÷¼¶±ðËùÌṩ²»Á˵ġ£±ÈÈ磬¶ÔPHP´úÂë½øÐÐÆÊÎö²»»áÏÔʾMySQLÓжàÉÙÐÐÓï¾äÖ´ÐÐÁË¡£
ÓëÓ¦ÓÃÆÊÎöÒ»Ñù£¬Ä¿±êÊÇ ......