mysqlÖеÄinsertʱעÒâ×ÔÔö³¤×ֶεÄд·¨
±ÈÈ磺
insert into User values(x1,x2,x3,x4),(x1,x2,x3,x4),(x1,x2,x3,x4)
ÕâÖÖд·¨£¬ÁÐÊýÁ¿±ØÐëºÍ±íÖÐËùÓÐÁб£³ÖÒ»Ö£¬Ò²¾ÍÊÇ˵Áж¼ÒªÁгöÀ´¡£
Õâ¸öuser±íÀïÃæµÄÒ»¸ö×Ö¶Îx1ÊǸö×ÔÔö³¤×ֶΣ¬ÔòÓ¦¸ÃÌînullռλ
insert into User values(null,x2,x3,x4),(null,x2,x3,x4),(null,x2,x3,x4)
·ñÔò»á±¨´í¡£
Ïà¹ØÎĵµ£º
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 ......
Ò»,½ñÌì¸ø´ó¼Ò½²Ò»ÏÂ,×öÁôÑÔµÄÒ»ÖÖ×·¼ÓµÄ·½Ê½Ö÷ÒªÈç¹ûµ±Ç°ÓÐÁôÑÔ,¾Í¸üе±Ç°µÄÁôÑÔÒÔ×·¼ÓµÄ·½Ê½,Èç¹ûûÄÜÁôÑԾͽ«ÈëÒ»ÌõеÄ
mysql:insert into `table` (field) values ('$value') on duplicate key update `field`=concat('value',ifnull(`field`,''));
¾ßÌå±¾ÌõSQLµÄÓ÷¨,Çë²é¿´ÊÖ²á
¶þ,½²Ò»ÏÂͳ¼ÆµÄÓ÷¨,Ö÷Òª½éÉÜÈçº ......
mysqlÖÐINSTRº¯ÊýµÄÓ÷¨
INSTR(×Ö¶ÎÃû, ×Ö·û´®)
Õâ¸öº¯Êý·µ»Ø×Ö·û´®ÔÚijһ¸ö×ֶεÄÄÚÈÝÖеÄλÖÃ, ûÓÐÕÒµ½×Ö·û´®·µ»Ø0£¬·ñÔò·µ»ØλÖ㨴Ó1¿ªÊ¼£©
SELECT * from tblTopic ORDER BY INSTR( topicTitle, 'ha' ) > 0 DESC
SELECT INSTR( topicTitle, 'ha' ) from tblTopic
mysqlÖÐʹÓÃinstrÅäºÏINÅÅÐò
½«instr½á¹û×÷Î ......
mysql 5.0´æ´¢¹ý³Ìѧϰ×ܽá
Ò».´´½¨´æ´¢¹ý³Ì
1.»ù±¾Óï·¨£º
create procedure sp_name()
begin
………
end
2.²ÎÊý´«µÝ
¶þ.µ÷Óô洢¹ý³Ì
1.»ù±¾Óï·¨£ºcall sp_name()
×¢Ò⣺´æ´¢¹ý³ÌÃû³ÆºóÃæ±ØÐë¼ÓÀ¨ºÅ£¬ÄÄŸô洢¹ý³ÌûÓвÎÊý´«µÝ
Èý.ɾ³ý´æ´¢¹ý³Ì
1.»ù±¾Óï·¨£º
drop procedure sp_na ......
MySql°æ±¾ÐÅÏ¢µÄ²éѯ£º
1¡¢Í¨¹ýmysql -VÃüÁî²éѯ
C:\mysql\bin>mysql -V
mysql Ver 12.22 Distrib 4.0.18, for Win95/Win98 (i32)
2¡¢Í¨¹ýmysqlģʽϵÄstatusÃüÁî²é¿´×´Ì¬
mysql> status
--------------
mysql Ver 12.22 Distrib 4.0.18, for Win95/Win98 (i32)
Connection id: &nbs ......