锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美噜噜久久久XXX,久久91这里精品国产2020,久久精品亚洲一区二区三区浴池http://www.shnenglu.com/API/category/16119.htmlzh-cnSun, 24 Jan 2016 03:15:13 GMTSun, 24 Jan 2016 03:15:13 GMT60瀹夎mysql5.7.10http://www.shnenglu.com/API/archive/2016/01/21/212705.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Thu, 21 Jan 2016 08:15:00 GMThttp://www.shnenglu.com/API/archive/2016/01/21/212705.htmlhttp://www.shnenglu.com/API/comments/212705.htmlhttp://www.shnenglu.com/API/archive/2016/01/21/212705.html#Feedback0http://www.shnenglu.com/API/comments/commentRss/212705.htmlhttp://www.shnenglu.com/API/services/trackbacks/212705.html1.鍘誨畼緗戜笅杞絟ttp://dev.mysql.com/downloads/mysql/閫夊叾涓殑Windows (x86, 64-bit), ZIP Archive鎴?strong style="box-sizing: inherit; margin: 0px; padding: 0px; border: 0px; outline: 0px; font-size: 12.960000038147px; vertical-align: baseline; line-height: 20.7360000610352px; background-image: initial; background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;">Windows (x86, 32-bit), ZIP Archive鐗堟湰
2.鍦╩ysql-5.7.10-winx64鐩綍涓嬶紝鏂板緩涓涓猰y.ini銆傚鍒朵笅闈㈢殑浠g爜淇濆瓨灝卞彲浠ヤ簡銆?/span>
[mysql]
; 璁劇疆mysql瀹㈡埛绔粯璁ゅ瓧絎﹂泦
default-character-set=utf8
[mysqld]
;璁劇疆3306绔彛
port = 3306 
; 璁劇疆mysql鐨勫畨瑁呯洰褰?/span>
basedir=D:\MYSQL\mysql-5.7.10-winx64
; 璁劇疆mysql鏁版嵁搴撶殑鏁版嵁鐨勫瓨鏀劇洰褰?/span>
datadir=D:\MYSQL\mysql-5.7.10-winx64\data
; 鍏佽鏈澶ц繛鎺ユ暟
max_connections=200
; 鏈嶅姟绔嬌鐢ㄧ殑瀛楃闆嗛粯璁や負8姣旂壒緙栫爜鐨刲atin1瀛楃闆?/span>
character-set-server=utf8
; 鍒涘緩鏂拌〃鏃跺皢浣跨敤鐨勯粯璁ゅ瓨鍌ㄥ紩鎿?/span>
default-storage-engine=MYISAM
3.鍦╳in涓嬩互綆$悊鍛樿韓浠借繍琛宑md
4.鍦╞in鐩綍涓嬶紝榪愯>mysqld install
5.鐒跺悗榪愯>mysqld  --initialize
  榪欎釜鍒濆鍖栨搷浣滃皢my.ini涓殑datadir鐩綍涓嬬敓鎴愭暟鎹簱鏂囦歡錛屼篃鍙互灝嗚閲岄潰鐨勬枃浠跺叏鍒犻櫎銆傞噸鏂拌緭鍏ヨ鍛戒護鍒濆鍖?br />6.鍚姩鏈嶅姟>net start mysql
7. 淇敼瀵嗙爜

鎵撳紑MySQL/bin鐩綍涓嬭緭鍏ysql -uroot -p ,榛樿鏄病鏈夊瘑鐮佺殑錛屼竴鑸槸鐩存帴鎸夊洖杞﹁繘鍏ワ紝浣嗘槸浼氬嚭鐜?/span>
ERROR 1045 (28000): Access denied for user'root'@'localhost'(using password: YES)鐨勯敊璇?銆?/span>
瑙e喅鐨勬柟娉曢兘鏄湪鍦ㄩ厤緗枃浠禰mysqld]鏉$洰涓嬪姞涓鏉″懡浠kip-grant-tables鐒跺悗閲嶅惎鏈嶅姟灝卞彲浠ョ暐榪囧瘑鐮佽繘鍏ヤ簡銆?/span>

鍦╟md閲岄潰杈撳叆mysql -u root-p灝卞彲浠ヤ笉鐢ㄥ瘑鐮佺櫥褰曚簡錛屽嚭鐜皃assword錛氱殑鏃跺欑洿鎺ュ洖杞﹀彲浠ヨ繘鍏ワ紝涓嶄細鍑虹幇ERROR 1045(28000)錛屼絾寰堝鎿嶄綔閮戒細鍙楅檺鍒訛紝鍥犱負娌℃湁涓嶈兘grant錛堟病鏈夋潈闄愶級鐨勫瘑鐮?/span>

(1).榪涘叆mysql鏁版嵁搴擄細

mysql> use mysql;Database changed

(2).緇檙oot鐢ㄦ埛璁劇疆鏂板瘑鐮乵ysql> update user set authentication_string=password("123456") where user="root";
 Query OK,1 rows affected(0.01 sec)Rows matched:1 Changed:1Warnings: 0

(3).鍒鋒柊鏁版嵁搴?nbsp;錛堜竴瀹氳璁板緱鍒鋒柊錛塵ysql>flush privileges; QueryOK, 0 rows affected (0.00 sec)

(4).閫鍑簃ysql錛歮ysql> quit

鏈鍚庢妸閰嶇疆鏂囦歡涓殑skip-grant-tables 娉ㄩ噴鎺夈備笅嬈¤緭鍏ysql -uroot -p 灝卞彲浠ョ敤鏂板瘑鐮佺櫥褰曚簡
8.濡傛灉鍐嶆榪涘叆杈撳叆 >show databases;鎻愮ず浠ヤ笅閿欒:
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
鍒欎慨鏀逛竴嬈″瘑鐮佸嵆鍙?>set password=password('123456');






]]>
mysql 淇濈暀N琛岀殑閲嶅璁板綍http://www.shnenglu.com/API/archive/2014/03/26/206349.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Wed, 26 Mar 2014 07:16:00 GMThttp://www.shnenglu.com/API/archive/2014/03/26/206349.htmlhttp://www.shnenglu.com/API/comments/206349.htmlhttp://www.shnenglu.com/API/archive/2014/03/26/206349.html#Feedback0http://www.shnenglu.com/API/comments/commentRss/206349.htmlhttp://www.shnenglu.com/API/services/trackbacks/206349.html
mysql> select * from t_value;
+----+------------+
| id | value      |
+----+------------+
|  1 |       1212 |
|  1 |    1234342 |
|  1 |         12 |
|  1 | 1243242341 |
|  2 |   43242341 |
|  2 |      43241 |
|  2 |    4333331 |
|  2 |          4 |
|  2 |  432456666 |
+----+------------+
9 rows in set
2. 鏈熸湜浠ヤ笂id涓?錛?鐨勫垎鍒彧淇濈暀涓ゆ潯
3.鏂板緩涓涓復鏃惰〃錛屽瓧孌靛悓涓婏紝騫舵柊澧炰竴涓猲um瀛楁涓鴻嚜澧炪傚茍鎻掑叆
insert into t_tmp(id,value) select id,value from t_value order by id;
4.浜庢槸t_tmp濡備笅錛?br />
mysql> select * from t_tmp;
+----+------------+-----+
| id | value      | num |
+----+------------+-----+
|  1 |       1212 |  79 |
|  1 |    1234342 |  80 |
|  1 |         12 |  81 |
|  1 | 1243242341 |  82 |
|  2 |   43242341 |  83 |
|  2 |      43241 |  84 |
|  2 |    4333331 |  85 |
|  2 |          4 |  86 |
|  2 |  432456666 |  87 |
+----+------------+-----+

5.鍐嶉氳繃浠ヤ笅SQL鏌ュ嚭
mysql> select t_tmp.id,t_tmp.value,t_tmp.num from t_tmp
left join(select num,id,value from t_tmp   group by id) as t
on t.id=t_tmp.id
where t_tmp.num<t.num+2;
+----+----------+-----+
| id | value    | num |
+----+----------+-----+
|  1 |     1212 |  79 |
|  1 |  1234342 |  80 |
|  2 | 43242341 |  83 |
|  2 |    43241 |  84 |
+----+----------+-----+


]]>
mysql緋葷粺琛╬rochttp://www.shnenglu.com/API/archive/2013/03/09/198319.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Sat, 09 Mar 2013 09:43:00 GMThttp://www.shnenglu.com/API/archive/2013/03/09/198319.htmlhttp://www.shnenglu.com/API/comments/198319.htmlhttp://www.shnenglu.com/API/archive/2013/03/09/198319.html#Feedback0http://www.shnenglu.com/API/comments/commentRss/198319.htmlhttp://www.shnenglu.com/API/services/trackbacks/198319.html1.鍦ㄧ郴緇熻〃proc涓殑definer瀛楁鐢ㄦ潵綆$悊瀛樺偍榪囩▼鐨勮闂潈闄?/div>

]]>
mysql瀵煎嚭琛ㄧ粨鏋勪笌瀛樺偍榪囩▼http://www.shnenglu.com/API/archive/2013/03/09/198318.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Sat, 09 Mar 2013 09:33:00 GMThttp://www.shnenglu.com/API/archive/2013/03/09/198318.htmlhttp://www.shnenglu.com/API/comments/198318.htmlhttp://www.shnenglu.com/API/archive/2013/03/09/198318.html#Feedback1http://www.shnenglu.com/API/comments/commentRss/198318.htmlhttp://www.shnenglu.com/API/services/trackbacks/198318.htmlmysqldump.exe -uroot -p123456 -d -R slot > slot.sql

]]>
MySQL鏁板瓧鐨勮繘鍒惰漿鎹?/title><link>http://www.shnenglu.com/API/archive/2013/01/14/197265.html</link><dc:creator>C++鎶鏈腑蹇?/dc:creator><author>C++鎶鏈腑蹇?/author><pubDate>Mon, 14 Jan 2013 09:45:00 GMT</pubDate><guid>http://www.shnenglu.com/API/archive/2013/01/14/197265.html</guid><wfw:comment>http://www.shnenglu.com/API/comments/197265.html</wfw:comment><comments>http://www.shnenglu.com/API/archive/2013/01/14/197265.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/API/comments/commentRss/197265.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/API/services/trackbacks/197265.html</trackback:ping><description><![CDATA[<p align="left"> MySQL鏁板瓧鐨勮繘鍒惰漿鎹?conv鐨勪嬌鐢?<br />CONV(N,from_base,to_base)<br />鍦ㄤ笉鍚岀殑鏁板瓧鍩烘暟涔嬮棿杞崲鏁板瓧銆傚皢鏁板瓧 N 浠巉rom_base 杞崲鍒?to_base錛屽茍浠ュ瓧絎︿覆褰㈠紡榪斿洖銆傚鏋滀換浣曚竴涓弬鏁頒負 NULL錛岄偅涔堣繑鍥炲間篃涓?NULL銆傚弬鏁?N 琚В閲婁負鏄竴涓暣鏁幫紝浣嗘槸涔熷彲浠ヨ鎸囧畾涓轟竴涓暣鏁版垨涓涓瓧絎︿覆銆傛渶灝忓熀涓?2錛屾渶澶у熀涓?36銆傚鏋?to_base 鏄竴涓礋鍊鹼紝N 灝嗚鐪嬩綔涓烘槸涓涓湁絎﹀彿鏁板瓧銆傚惁鍒欙紝N 琚涓烘槸鏃犵鍙風殑銆侰ONV 浠?64 浣嶇簿搴﹀伐浣溿?br /><br /><a class="keylink" target="_blank">mysql</a>> select conv(100,10,2);<br />+----------------+<br />| conv(100,10,2) |<br />+----------------+<br />| 1100100 |<br />+----------------+</p> <div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /><span style="color: #0000ff">insert</span><span style="color: #000000"> ignore </span><span style="color: #0000ff">into</span><span style="color: #000000"> tbl_Device_User_Info_1  (deviceKey,iggid,userid,DriveType,LastLoginTime,Param1,DeviceID) </span><span style="color: #0000ff">select</span><span style="color: #000000"> deviceKey,iggid,userid,DriveType,LastLoginTime,Param1,DeviceID </span><span style="color: #0000ff">from</span><span style="color: #000000"> tbl_Device_User_Info_Mix </span><span style="color: #0000ff">where</span><span style="color: #000000"> conv(</span><span style="color: #ff00ff">right</span><span style="color: #000000">(deviceKey,</span><span style="color: #800000; font-weight: bold">4</span><span style="color: #000000">),</span><span style="color: #800000; font-weight: bold">16</span><span style="color: #000000">,</span><span style="color: #800000; font-weight: bold">10</span><span style="color: #000000">) mod </span><span style="color: #800000; font-weight: bold">40</span><span style="color: #000000"> </span><span style="color: #808080">+</span><span style="color: #800000; font-weight: bold">1</span><span style="color: #000000"> </span><span style="color: #808080">=</span><span style="color: #000000"> </span><span style="color: #800000; font-weight: bold">1</span><span style="color: #000000"> ;</span></div> <p align="left"><br /><br /></p><img src ="http://www.shnenglu.com/API/aggbug/197265.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/API/" target="_blank">C++鎶鏈腑蹇?/a> 2013-01-14 17:45 <a href="http://www.shnenglu.com/API/archive/2013/01/14/197265.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>MySql涓彃鍏ヤ腑鏂囨姤閿欙細incorrect string value http://www.shnenglu.com/API/archive/2012/10/15/193304.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Mon, 15 Oct 2012 05:14:00 GMThttp://www.shnenglu.com/API/archive/2012/10/15/193304.htmlhttp://www.shnenglu.com/API/comments/193304.htmlhttp://www.shnenglu.com/API/archive/2012/10/15/193304.html#Feedback0http://www.shnenglu.com/API/comments/commentRss/193304.htmlhttp://www.shnenglu.com/API/services/trackbacks/193304.html SHOW VARIABLES LIKE 'character_set_%';

鏈榪戝悜錛綑錛籌急錛暟鎹簱鎻掑叆鏁版嵁鏃跺嚭鐜頒簡涓涓棶棰橈紝鎶ュ憡涓枃閿欒錛歩ncorrect string value 錛庯紟錛庯紟錛庡湪緗戜笂鎼滀簡涓浜涜祫鏂欎篃閮芥槸瀹芥硾鐨勮璇達紝鑷繁緇煎悎鍚勫涔嬮暱錛岃瘯浜嗚瘯錛屽彂鐜版妸鏁版嵁搴撶紪鐮併侀〉闈㈢紪鐮佸拰錛絹锝栵絹鏂囦歡緙栫爜淇敼鎴愮粺涓鐨勭紪鐮佹柟妗堝氨琛屼簡銆?/span>

銆鍦輯锝欙汲錛憋棘鍛戒護紿楀彛涓嬭緭鍏ワ技锝撳氨鍙互鏌ョ湅褰撳墠鏁版嵁搴撶殑緙栫爜浜嗐?/span>

淇敼鏂規硶

欏甸潰鍜孞ava鏂囦歡涓殑淇敼灝變笉璇翠簡錛屽ぇ瀹惰偗瀹氶兘浼氾紝鍙璇存庢牱淇敼MySQL鐨勫惂銆?/span>

淇敼鏁版嵁搴撶紪鐮佺殑鍛戒護鏄細ALTER DATABASE `test` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin

銆淇敼琛ㄧ殑緙栫爜鐨勫懡浠ゆ槸錛欰LTER TABLE `category` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin

銆淇敼琛ㄤ腑瀛楁鐨勭紪鐮佺殑鍛戒護鏄細ALTER TABLE `test` CHANGE `dd` `dd` VARCHAR( 45 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL

淇敼MySQL榛樿緙栫爜鏂規錛屽湪windows鐜涓?/strong>鍙互鐩存帴鐢∕ysql Server Instance Config Wizard 榪涜璁劇疆

Linux鐜涓?/strong>

/etc/init.d/mysql start (stop) 涓哄惎鍔ㄥ拰鍋滄鏈嶅姟鍣?/span>

銆銆/etc/mysql/ 涓昏閰嶇疆鏂囦歡鎵鍦ㄤ綅緗?my.cnf

銆銆/var/lib/mysql/ 鏀劇疆鐨勬槸鏁版嵁搴撹〃鏂囦歡澶癸紝榪欓噷鐨刴ysql鐩稿綋浜巜indows涓媘ysql鐨刣ate鏂囦歡澶?/p>

銆銆鍚姩mysql鍚庯紝浠oot鐧誨綍mysql

銆銆isher@isher-ubuntu:~$ mysql -u root

銆銆>show variables like 'character%'; #鎵ц緙栫爜鏄劇ず

銆銆+--------------------------+----------------------------+

銆銆| Variable_name | Value |

銆銆+--------------------------+----------------------------+

銆銆| character_set_client | latin1 |

銆銆| character_set_connection | latin1 |

銆銆| character_set_database | latin1 |

銆銆| character_set_filesystem | binary |

銆銆| character_set_results | latin1 |

銆銆| character_set_server | latin1 |

銆銆| character_set_system | utf8 |

銆銆| character_sets_dir | /usr/share/mysql/charsets/ |

銆銆+--------------------------+----------------------------+

銆銆鍦ㄦ煇浜涙椂鍊欙紝鎴戜滑緇淇敼mysql榛樿鏁版嵁搴撶殑緙栫爜錛屼互淇濊瘉鏌愪簺榪佺Щ鐨勭▼搴忓彲浠ユ甯告樉紺猴紝緙栬緫my.cnf鏂囦歡榪涜緙栫爜淇敼,windows鍙互鐩存帴鐢∕ysql Server Instance Config Wizard 榪涜璁劇疆

銆銆鍦╨inux涓嬩慨鏀?涓猰y.cnf鐨?涓?etc/mysql/my.cnf鏂囦歡

銆銆鎵懼埌瀹㈡埛绔厤緗甗client] 鍦ㄤ笅闈㈡坊鍔?/p>

銆銆default-character-set=utf8 榛樿瀛楃闆嗕負utf8

銆銆鍦ㄦ壘鍒癧mysqld] 娣誨姞

銆銆default-character-set=utf8 榛樿瀛楃闆嗕負utf8

銆銆init_connect='SET NAMES utf8' (璁懼畾榪炴帴mysql鏁版嵁搴撴椂浣跨敤utf8緙栫爜錛屼互璁﹎ysql鏁版嵁搴撲負utf8榪愯)

銆銆淇敼濂藉悗錛岄噸鏂板惎鍔╩ysql 鍗沖彲錛屾煡璇竴涓媠how variables like 'character%';

銆銆+--------------------------+----------------------------+

銆銆| Variable_name | Value |

銆銆+--------------------------+----------------------------+

銆銆| character_set_client | utf8 |

銆銆| character_set_connection | utf8 |

銆銆| character_set_database | utf8 |

銆銆| character_set_filesystem | binary |

銆銆| character_set_results | utf8 |

銆銆| character_set_server | utf8 |

銆銆| character_set_system | utf8 |

銆銆| character_sets_dir | /usr/share/mysql/charsets/ |

銆銆+--------------------------+----------------------------+

銆銆姝ゆ柟娉曠敤浜庢爣鍑唌ysql鐗堟湰鍚屾牱鏈夋晥錛屽浜?etc/my.cnf鏂囦歡錛岄渶瑕佷粠mysql/support-files鐨勬枃浠跺すcp my-large.cnf涓浠藉埌/etc/my.cnf銆?/p>

]]>
鎵歸噺淇敼琛ㄥ紩鎿?/title><link>http://www.shnenglu.com/API/archive/2012/09/12/190421.html</link><dc:creator>C++鎶鏈腑蹇?/dc:creator><author>C++鎶鏈腑蹇?/author><pubDate>Wed, 12 Sep 2012 10:06:00 GMT</pubDate><guid>http://www.shnenglu.com/API/archive/2012/09/12/190421.html</guid><wfw:comment>http://www.shnenglu.com/API/comments/190421.html</wfw:comment><comments>http://www.shnenglu.com/API/archive/2012/09/12/190421.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/API/comments/commentRss/190421.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/API/services/trackbacks/190421.html</trackback:ping><description><![CDATA[<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /><span style="color: #0000ff">drop</span><span style="color: #000000"> </span><span style="color: #0000ff">procedure</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000"> </span><span style="color: #808080">exists</span><span style="color: #000000"> sp_TableEng;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">create</span><span style="color: #000000"> </span><span style="color: #0000ff">procedure</span><span style="color: #000000">  sp_TableEng(dbname </span><span style="color: #000000; font-weight: bold">varchar</span><span style="color: #000000">(</span><span style="color: #800000; font-weight: bold">50</span><span style="color: #000000">))<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">BEGIN</span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />    <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />    </span><span style="color: #0000ff">DECLARE</span><span style="color: #000000"> done </span><span style="color: #000000; font-weight: bold">INT</span><span style="color: #000000"> </span><span style="color: #0000ff">DEFAULT</span><span style="color: #000000"> </span><span style="color: #800000; font-weight: bold">0</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />    </span><span style="color: #0000ff">DECLARE</span><span style="color: #000000"> v_tbname </span><span style="color: #000000; font-weight: bold">varchar</span><span style="color: #000000">(</span><span style="color: #800000; font-weight: bold">500</span><span style="color: #000000">) </span><span style="color: #0000ff">default</span><span style="color: #000000"> </span><span style="color: #ff0000">''</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  </span><span style="color: #0000ff">DECLARE</span><span style="color: #000000"> v_schema </span><span style="color: #000000; font-weight: bold">varchar</span><span style="color: #000000">(</span><span style="color: #800000; font-weight: bold">500</span><span style="color: #000000">) </span><span style="color: #0000ff">default</span><span style="color: #000000"> </span><span style="color: #ff0000">''</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />    </span><span style="color: #008080">--</span><span style="color: #008080"> 鏄劇ず鎬昏褰曟暟</span><span style="color: #008080"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #000000">    <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  </span><span style="color: #0000ff">DECLARE</span><span style="color: #000000"> curPos </span><span style="color: #0000ff">CURSOR</span><span style="color: #000000"> </span><span style="color: #0000ff">FOR</span><span style="color: #000000"> </span><span style="color: #0000ff">select</span><span style="color: #000000"> table_schema,table_name </span><span style="color: #0000ff">from</span><span style="color: #000000"> information_schema.tables </span><span style="color: #0000ff">where</span><span style="color: #000000"> table_schema </span><span style="color: #808080">in</span><span style="color: #000000">(dbname) </span><span style="color: #808080">and</span><span style="color: #000000"> engine</span><span style="color: #808080">=</span><span style="color: #ff0000">'</span><span style="color: #ff0000">InnoDB</span><span style="color: #ff0000">'</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  </span><span style="color: #0000ff">DECLARE</span><span style="color: #000000"> </span><span style="color: #0000ff">CONTINUE</span><span style="color: #000000"> HANDLER </span><span style="color: #0000ff">FOR</span><span style="color: #000000"> </span><span style="color: #808080">NOT</span><span style="color: #000000"> FOUND </span><span style="color: #0000ff">SET</span><span style="color: #000000"> done</span><span style="color: #808080">=</span><span style="color: #800000; font-weight: bold">1</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  </span><span style="color: #0000ff">select</span><span style="color: #000000"> </span><span style="color: #ff00ff">count</span><span style="color: #000000">(</span><span style="color: #808080">*</span><span style="color: #000000">) </span><span style="color: #0000ff">from</span><span style="color: #000000"> information_schema.tables </span><span style="color: #0000ff">where</span><span style="color: #000000"> table_schema </span><span style="color: #808080">in</span><span style="color: #000000">(dbname) </span><span style="color: #808080">and</span><span style="color: #000000"> engine</span><span style="color: #808080">=</span><span style="color: #ff0000">'</span><span style="color: #ff0000">InnoDB</span><span style="color: #ff0000">'</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  </span><span style="color: #0000ff">OPEN</span><span style="color: #000000"> curPos;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  REPEAT<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />             </span><span style="color: #0000ff">FETCH</span><span style="color: #000000"> curPos </span><span style="color: #0000ff">INTO</span><span style="color: #000000"> v_schema,v_tbname;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />             <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />             </span><span style="color: #0000ff">if</span><span style="color: #000000"> </span><span style="color: #808080">not</span><span style="color: #000000"> done </span><span style="color: #0000ff">then</span><span style="color: #000000"><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />                 <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />                   </span><span style="color: #0000ff">set</span><span style="color: #000000"> </span><span style="color: #008000">@sql_delete</span><span style="color: #000000"> </span><span style="color: #808080">=</span><span style="color: #000000">concat(</span><span style="color: #ff0000">'</span><span style="color: #ff0000">alter table </span><span style="color: #ff0000">'</span><span style="color: #000000">,v_schema,</span><span style="color: #ff0000">'</span><span style="color: #ff0000">.</span><span style="color: #ff0000">'</span><span style="color: #000000">,v_tbname, </span><span style="color: #ff0000">'</span><span style="color: #ff0000"> engine=</span><span style="color: #ff0000">''</span><span style="color: #ff0000">MyISAM</span><span style="color: #ff0000">'''</span><span style="color: #000000">);                   <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />                         </span><span style="color: #0000ff">prepare</span><span style="color: #000000"> sql_del </span><span style="color: #0000ff">from</span><span style="color: #000000"> </span><span style="color: #008000">@sql_delete</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />                      </span><span style="color: #0000ff">execute</span><span style="color: #000000"> sql_del;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />                       <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />              </span><span style="color: #0000ff">end</span><span style="color: #000000"> </span><span style="color: #0000ff">if</span><span style="color: #000000">;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />              <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  UNTIL done </span><span style="color: #0000ff">END</span><span style="color: #000000"> REPEAT;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  <br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" />  </span><span style="color: #0000ff">close</span><span style="color: #000000"> curPos;<br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /><br /><img align="top" src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" alt="" /></span><span style="color: #0000ff">end</span><span style="color: #000000">;</span></div><img src ="http://www.shnenglu.com/API/aggbug/190421.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/API/" target="_blank">C++鎶鏈腑蹇?/a> 2012-09-12 18:06 <a href="http://www.shnenglu.com/API/archive/2012/09/12/190421.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍚堟湇鏃舵敞鎰忎簨欏?/title><link>http://www.shnenglu.com/API/archive/2012/09/06/189659.html</link><dc:creator>C++鎶鏈腑蹇?/dc:creator><author>C++鎶鏈腑蹇?/author><pubDate>Thu, 06 Sep 2012 03:02:00 GMT</pubDate><guid>http://www.shnenglu.com/API/archive/2012/09/06/189659.html</guid><wfw:comment>http://www.shnenglu.com/API/comments/189659.html</wfw:comment><comments>http://www.shnenglu.com/API/archive/2012/09/06/189659.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/API/comments/commentRss/189659.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/API/services/trackbacks/189659.html</trackback:ping><description><![CDATA[<div>1. 娉ㄦ剰鏂扮敓鎴愮殑ID鏄惁鏈夊厖紿?br />2. 鍒犻櫎鏁版嵁鏃訛紝涓嶈浣跨敤delete from tbl where fd1 in(select fb1 from tb2);榪欐牱鐨勫彞閲婏紝搴旇浣跨敤<br />   delete tb1 from tb1,tb2 where tb1.fd1 = tb2.fd1;<br /><br />3.鍦ㄥ悎鏁版嵁鏃訛紝娉ㄦ剰瀛樺偍榪囩▼鐨勫彲鍐嶅叆鎬э紝鍗籌紝宸茬粡鍚堣繃鐨勮處鍙蜂俊鎭紝搴旇娉ㄦ剰鏍囪錛屼互鍏嶆剰澶栨儏鍐墊墦鏂椂<br />   鍙互緇х畫鎵ц瀛樺偍榪囩▼銆?br /><br />4.濡傛灉涓涓瓨鍌ㄨ繃紼嬪悎騫舵瘮杈冨鏉傦紝璐﹀彿淇℃伅澶氾紝娉ㄦ剰鐢ㄥ彇妯$殑鏂瑰紡鍒嗗紑鎵ц銆傛瘮濡傚垎10嬈★紝鎴栬呮洿澶氭鏁板幓鎵ц鍚堝茍瀛樺偍榪囩▼銆?br />    濡傛灉N鏉QL鍙互寮澶氫釜緇堢鍒嗗紑鍚屾椂鎵ц銆?br /><br />5.娉ㄦ剰鍦ㄩ潪甯歌楁椂鐨勫瓨鍌ㄨ繃紼嬩腑錛屽姞鍏ユ墽琛岃繘搴︼紝鍙互鍗蟲椂鐭ラ亾鎵ц鎯呭喌銆?/div><img src ="http://www.shnenglu.com/API/aggbug/189659.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/API/" target="_blank">C++鎶鏈腑蹇?/a> 2012-09-06 11:02 <a href="http://www.shnenglu.com/API/archive/2012/09/06/189659.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>mysql澶氳〃鍏寵仈鍒犻櫎http://www.shnenglu.com/API/archive/2012/09/05/189557.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Wed, 05 Sep 2012 06:57:00 GMThttp://www.shnenglu.com/API/archive/2012/09/05/189557.htmlhttp://www.shnenglu.com/API/comments/189557.htmlhttp://www.shnenglu.com/API/archive/2012/09/05/189557.html#Feedback0http://www.shnenglu.com/API/comments/commentRss/189557.htmlhttp://www.shnenglu.com/API/services/trackbacks/189557.htmlDELETE鍒犻櫎澶氳〃鏁版嵁錛屾庢牱鎵嶈兘鍚屾椂鍒犻櫎澶氫釜鍏寵仈琛ㄧ殑鏁版嵁鍛紵榪欓噷鍋氫簡娣卞叆鐨勮В閲婏細
1 delete from t1 where 鏉′歡
2 delete t1 from t1 where 鏉′歡
3 delete t1 from t1,t2 where 鏉′歡
4 delete t1,t2 from t1,t2 where 鏉′歡


鍓?3鑰呮槸鍙鐨勶紝絎?鑰呬笉鍙銆?br />涔熷氨鏄畝鍗曠敤delete璇彞鏃犳硶榪涜澶氳〃鍒犻櫎鏁版嵁鎿嶄綔錛屼笉榪囧彲浠ュ緩绔嬬駭鑱斿垹闄わ紝鍦ㄤ袱涓〃涔嬮棿寤虹珛綰ц仈鍒犻櫎鍏崇郴錛屽垯鍙互瀹炵幇鍒犻櫎涓涓〃鐨勬暟鎹椂錛屽悓鏃跺垹闄ゅ彟涓涓〃涓浉鍏崇殑鏁版嵁銆?br />
1銆佷粠鏁版嵁琛╰1涓妸閭d簺id鍊煎湪鏁版嵁琛╰2閲屾湁鍖歸厤鐨勮褰曞叏鍒犻櫎鎺? DELETE t1 FROM t1,t2 WHERE t1.id=t2.id 鎴?DELETE FROM t1 USING t1,t2 WHERE t1.id=t2.id


2銆佷粠鏁版嵁琛╰1閲屽湪鏁版嵁琛╰2閲屾病鏈夊尮閰嶇殑璁板綍鏌ユ壘鍑烘潵騫跺垹闄ゆ帀1 DELETE t1 FROM t1 LEFT JOIN T2 ON t1.id=t2.id WHERE t2.id IS NULL 鎴?DELETE FROM t1,USING t1 LEFT JOIN T2 ON t1.id=t2.id WHERE t2.id IS NULL


3銆?浠庝袱涓〃涓壘鍑虹浉鍚岃褰曠殑鏁版嵁騫舵妸涓や釜琛ㄤ腑鐨勬暟鎹兘鍒犻櫎鎺? DELETE t1,t2 from t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t1.id=25


娉ㄦ剰姝ゅ鐨刣elete t1,t2 from 涓殑t1,t2涓嶈兘鏄埆鍚?br />
濡傦細1 delete t1,t2 from table_name as t1 left join table2_name as t2 on t1.id=t2.id where table_name.id=25


鍦ㄦ暟鎹噷闈㈡墽琛屾槸閿欒鐨勶紙MYSQL 鐗堟湰涓嶅皬浜?.0鍦?.0涓槸鍙互鐨勶級

涓婅堪璇彞鏀?鍐欐垚1 delete table_name,table2_name from table_name as t1 left join table2_name as t2 on t1.id=t2.id where table_name.id=25


鍦ㄦ暟鎹噷闈㈡墽琛屾槸閿欒鐨勶紙MYSQL 鐗堟湰灝忎簬5.0鍦?.0涓槸鍙互鐨勶級


]]>
mysql淇敼琛ㄥ紩鎿?/title><link>http://www.shnenglu.com/API/archive/2012/09/04/189394.html</link><dc:creator>C++鎶鏈腑蹇?/dc:creator><author>C++鎶鏈腑蹇?/author><pubDate>Tue, 04 Sep 2012 03:07:00 GMT</pubDate><guid>http://www.shnenglu.com/API/archive/2012/09/04/189394.html</guid><wfw:comment>http://www.shnenglu.com/API/comments/189394.html</wfw:comment><comments>http://www.shnenglu.com/API/archive/2012/09/04/189394.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/API/comments/commentRss/189394.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/API/services/trackbacks/189394.html</trackback:ping><description><![CDATA[ALTER TABLE tbl_achievement_51  ENGINE=MyISAM;<img src ="http://www.shnenglu.com/API/aggbug/189394.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/API/" target="_blank">C++鎶鏈腑蹇?/a> 2012-09-04 11:07 <a href="http://www.shnenglu.com/API/archive/2012/09/04/189394.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>mysql 鐨刬nnodb浼樺寲http://www.shnenglu.com/API/archive/2012/07/30/185629.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Mon, 30 Jul 2012 07:00:00 GMThttp://www.shnenglu.com/API/archive/2012/07/30/185629.htmlhttp://www.shnenglu.com/API/comments/185629.htmlhttp://www.shnenglu.com/API/archive/2012/07/30/185629.html#Feedback0http://www.shnenglu.com/API/comments/commentRss/185629.htmlhttp://www.shnenglu.com/API/services/trackbacks/185629.html    鐪嬫潵涔熻浣犲繕浜嗕慨鏀硅繖涓弬鏁頒簡銆?br />          榛樿鍊兼槸 1錛岃繖鎰忓懗鐫姣忔鎻愪氦鐨勬洿鏂頒簨鍔★紙鎴栬呮瘡涓簨鍔′箣澶栫殑璇彞錛夐兘浼氬埛鏂板埌紓佺洏涓紝鑰岃繖鐩稿綋鑰楄垂璧勬簮錛屽挨鍏舵槸娌℃湁鐢墊睜澶囩敤緙撳瓨鏃躲?br />                         寰堝搴旂敤紼嬪簭錛屽挨鍏舵槸浠?MyISAM杞彉榪囨潵鐨勯偅浜涳紝鎶婂畠鐨勫艱緗負 2 灝卞彲浠ヤ簡錛屼篃灝辨槸涓嶆妸鏃ュ織鍒鋒柊鍒扮鐩樹笂錛岃屽彧鍒鋒柊鍒版搷
                         浣滅郴緇熺殑緙撳瓨涓娿傛棩蹇椾粛鐒朵細姣忕鍒鋒柊鍒扮鐩樹腑鍘伙紝鍥犳閫氬父涓嶄細涓㈠け姣忕1-2嬈℃洿鏂扮殑娑堣椼傚鏋滆緗負 0 灝卞揩寰堝浜嗭紝涓嶈繃涔?br />                         鐩稿涓嶅畨鍏ㄤ簡銆侻ySQL鏈嶅姟鍣ㄥ穿婧冩椂灝變細涓㈠け涓浜涗簨鍔°傝緗負 2 鎸囨尌涓㈠け鍒鋒柊鍒版搷浣滅郴緇熺紦瀛樼殑閭i儴鍒嗕簨鍔°?img src ="http://www.shnenglu.com/API/aggbug/185629.html" width = "1" height = "1" />

]]>
Mysql鍙︿竴縐嶆彃鍏ヨ娉?濡傛灉鍞竴鍐茬獊,鍒欎笉鎻掑叆,鎵ц鏇存柊)http://www.shnenglu.com/API/archive/2012/06/14/178765.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Thu, 14 Jun 2012 02:02:00 GMThttp://www.shnenglu.com/API/archive/2012/06/14/178765.htmlhttp://www.shnenglu.com/API/comments/178765.htmlhttp://www.shnenglu.com/API/archive/2012/06/14/178765.html#Feedback1http://www.shnenglu.com/API/comments/commentRss/178765.htmlhttp://www.shnenglu.com/API/services/trackbacks/178765.htmlINSERT INTO tbl_user_private_info(user_id, nick_name, sex, sub_type, device_type, tag) values( inUserId, inNickName, inSex, inSubType, inDeviceType, inTag)
        
ON DUPLICATE KEY UPDATE nick_name=inNickName, sex=inSex, sub_type=inSubType, device_type=inDeviceType, tag=inTag;

]]>
鎹曡幏mysql寮傚父http://www.shnenglu.com/API/archive/2012/05/06/173819.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Sun, 06 May 2012 06:41:00 GMThttp://www.shnenglu.com/API/archive/2012/05/06/173819.htmlhttp://www.shnenglu.com/API/comments/173819.htmlhttp://www.shnenglu.com/API/archive/2012/05/06/173819.html#Feedback0http://www.shnenglu.com/API/comments/commentRss/173819.htmlhttp://www.shnenglu.com/API/services/trackbacks/173819.html/**mySql涓槸鍚﹁兘鏈塖QLserver鐨凘@error鍙橀噺鍛紝鎴栬呭c#涓殑try catch璇硶鍛€?nbsp; 

絳旀鏄偗瀹氱殑錛屽疄渚嬩唬鐮佸涓嬶細*
*/
  


DROP PROCEDURE IF EXISTS sp_call_jobs;  

CREATE PROCEDURE sp_call_jobs()  

     
NOT DETERMINISTIC  

   SQL SECURITY DEFINER  

     COMMENT 
'' 

 
BEGIN 

 
declare _row,_err,_count int default 0;  

 
DECLARE CONTINUE  HANDLER FOR SQLEXCEPTION,SQLWARNING,NOT FOUND set _err=1;  

while _row<3 DO  

   START 
TRANSACTION;  

      
insert into t1(cond_val)values(null);  

  
COMMIT;  

  
if _err=1 then 

    
set _count=_count+1;  

  
end if;  

  
set _row=_row+1;  

 
end while;  

 
select _count;  

 
END;  

     

/**璇彞錛?nbsp; 

DECLARE CONTINUE  HANDLER FOR SQLEXCEPTION,SQLWARNING,NOT FOUND set _err=1;  

 浣滅敤鏄綋閬囧埌SQLEXCEPTION,SQLWARNING,NOT FOUND 閿欒鏃訛紝璁劇疆_err=1騫舵墽琛孋ONTINUE鎿嶄綔錛屽嵆緇х畫鎵ц鍚庨潰鐨勮鍙ャ?nbsp; 

 榪欏氨涓巆錛冧腑鐨則ry catch璇硶寰堝儚銆?nbsp; 

鑰屼笖鍦ㄦ墽琛屽彲鑳藉嚭閿欑殑璇彞鐨勬椂鍊欐垜浠敤浜嬪姟璇彞錛歋TART TRANSACTION; …… COMMIT; 鍙互淇濊瘉瀹屾暣鎬с?nbsp; 

 *
*/
 


]]>
shell鎿嶄綔mysqlhttp://www.shnenglu.com/API/archive/2012/03/28/169251.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Wed, 28 Mar 2012 02:58:00 GMThttp://www.shnenglu.com/API/archive/2012/03/28/169251.htmlhttp://www.shnenglu.com/API/comments/169251.htmlhttp://www.shnenglu.com/API/archive/2012/03/28/169251.html#Feedback1http://www.shnenglu.com/API/comments/commentRss/169251.htmlhttp://www.shnenglu.com/API/services/trackbacks/169251.html鏂規1
mysql -uuser -ppasswd -e"insert LogTable values()"  

浼樼偣錛氳鍙ョ畝鍗?/div>
緙虹偣錛氭敮鎸佺殑sql鐩稿綆鍗?/div>

鏂規2

鍑嗗涓涓猻ql鑴氭湰錛屽悕瀛椾負update.sql錛屼緥濡傦細
CREATE TABLE `user` (  
  `id` 
varchar(36NOT NULL COMMENT '涓婚敭',  
  `username` 
varchar(50NOT NULL COMMENT '鐢ㄦ埛鍚?/span>',  
  `password` 
varchar(50NOT NULL COMMENT '鐢ㄦ埛瀵嗙爜',  
  `createdate` date 
NOT NULL COMMENT '鍒涘緩鏃墮棿',  
  `age` 
int(11NOT NULL COMMENT '騫撮緞',  
  
PRIMARY KEY  (`id`)  
) ENGINE
=MyISAM DEFAULT CHARSET=utf8 COMMENT='鐢ㄦ埛淇℃伅琛?/span>';  
DROP TABLE IF EXISTS `visit_log`;  
CREATE TABLE `visit_log` (  
  `id` 
varchar(36character set utf8 NOT NULL,  
  `type` 
int(11NOT NULL,  
  `content` 
text character set utf8 NOT NULL,  
  `createdate` date 
NOT NULL,  
  
PRIMARY KEY  (`id`)  
) ENGINE
=MyISAM DEFAULT CHARSET=latin1 COMMENT='璁塊棶鏃ュ織';  

鏂板緩涓涓猽pdate_mysql.sh錛屽唴瀹瑰涓嬶細
use chbdb;  
source update.sql

鐒跺悗鎵ц濡備笅鍛戒護錛?br />
cat update_mysql.sh | mysql --user=root -ppassword  

浼樼偣錛氭敮鎸佸鏉傜殑sql鑴氭湰
緙虹偣錛?/strong>
1> 闇瑕佷袱涓枃浠訛細update.sql鍜寀pdate_mysql.sh
2> 涓鏃︿腑闂村嚭閿欙紝涔嬪悗鑴氭湰灝變笉浼氭墽琛岋紝渚嬪錛?/span>
濡傛灉絎竴寮犺〃宸茬粡瀛樺湪錛屽垯浼氭姤鍑哄涓嬪紓甯革細
ERROR 1050 (42S01) at line 1 in file: 'update.sql': Table 'user' already exists
鐒跺悗鑴氭湰閫鍑猴紝絎簩寮犺〃涔熷氨鏃犳硶鍒涘緩銆?/span>


鏂規3
鏂板緩涓涓猻hell鑴氭湰錛屾牸寮忓涓嬶細
#!/bin/bash   
mysql -u* -h* -p* <<EOF  
Your SQL script.  
EOF  

浼樼偣錛?/strong>
1>鏀寔澶嶆潅鐨剆ql鑴氭湰
2>鏃犻渶鍏跺畠棰濆鏂囦歡
緙虹偣錛?/strong>
1> 琛ㄥ悕銆佸瓧孌典笉鑳戒嬌鐢ㄥ崟寮曞彿錛岄渶瑕佷慨鏀瑰師鏈塻ql璇彞
2> 涓鏃︿腑闂村嚭閿欙紝涔嬪悗鑴氭湰灝變笉浼氭墽琛岋紝渚嬪錛?/span>
濡傛灉絎竴寮犺〃宸茬粡瀛樺湪錛屽垯浼氭姤鍑哄涓嬪紓甯革細
ERROR 1050 (42S01) at line 1 in file: 'update.sql': Table 'user' already exists
鐒跺悗鑴氭湰閫鍑猴紝絎簩寮犺〃涔熷氨鏃犳硶鍒涘緩銆?/span>


鏂規4
鍑嗗涓涓猻ql鑴氭湰錛屽update.sql錛岀劧鍚庢墽琛屽涓嬪懡浠わ細

mysql -uroot -ppassword < update.sql  

浼樼偣錛?span style="font-weight: normal">鏀寔澶嶆潅鐨剆ql鑴氭湰
緙虹偣錛?/strong>
1> 涓鏃︿腑闂村嚭閿欙紝涔嬪悗鑴氭湰灝變笉浼氭墽琛岋紝渚嬪錛?/span>
濡傛灉絎竴寮犺〃宸茬粡瀛樺湪錛屽垯浼氭姤鍑哄涓嬪紓甯革細
ERROR 1050 (42S01) at line 1 in file: 'update.sql': Table 'user' already exists
鐒跺悗鑴氭湰閫鍑猴紝絎簩寮犺〃涔熷氨鏃犳硶鍒涘緩銆?/span>
 
 



]]>linux mysql鐢ㄦ埛綆$悊 http://www.shnenglu.com/API/archive/2012/03/27/169165.htmlC++鎶鏈腑蹇?/dc:creator>C++鎶鏈腑蹇?/author>Tue, 27 Mar 2012 09:08:00 GMThttp://www.shnenglu.com/API/archive/2012/03/27/169165.htmlhttp://www.shnenglu.com/API/comments/169165.htmlhttp://www.shnenglu.com/API/archive/2012/03/27/169165.html#Feedback0http://www.shnenglu.com/API/comments/commentRss/169165.htmlhttp://www.shnenglu.com/API/services/trackbacks/169165.html

涓銆乺oot鐢ㄦ埛瀵嗙爜鐨勭淮鎶わ細

       鐢變簬瀹夎MySQL瀹屽悗,MySQL浼氳嚜鍔ㄦ彁渚涗竴涓笉甯﹀瘑鐮佺殑root鐢ㄦ埛錛屼負浜嗗畨鍏ㄨ搗瑙佺粰root璁劇疆瀵嗙爜錛?/p>

       #mysqladmin -u root password 123 (123涓哄瘑鐮侊紝涔熷彲浠ュ啓鎴?'123'鎴?123") 錛?/p>

       璁劇疆瀵嗙爜鍚庣櫥鍏ユ椂灝變笉鑳界洿鎺ヨ緭鍏ysql浜嗭紝蹇呴』璺熶簺鍙傛暟浜?濡備笅錛?/p>

       [root@localhost ~]# mysql -u root -p 錛?u 鍚庤窡鐧誨叆鐨勭敤鎴峰悕錛?p 鎻愮ず瑕佸瘑鐮佺櫥鍏ワ級
       Enter password:(杈撳叆瀵嗙爜)

 

       淇敼瀵嗙爜錛?/p>

       [root@localhost ~] #mysqladmin -u root  -p  password  123456 (password 鍚庤窡鐨勬槸瑕佹洿鏂扮殑鏂板瘑鐮?
       Enter password:(杈撳叆鍘熷瀵嗙爜錛屽洖杞﹀嵆鍙?

 

浜屻佸叾浠栫敤鎴風殑澧炲姞鍜屽垹闄わ細

      浠oot鐢ㄦ埛鐧誨叆錛屽湪mysql涓湁涓寮爉ysql.user琛ㄦ槸瀛樺偍MySQL涓墍鏈夌敤鎴風殑淇℃伅琛紝鎵浠ュ彲浠ョ洿鎺ュ鍔犲垹闄よ繖涓〃鐨勮褰曞氨鍙鍔犲拰鍒犻櫎鐢ㄦ埛錛?/p>

 

     1.娣誨姞鐢ㄦ埛錛堟湁涓ょ褰㈠紡錛夛細

       A.mysql> grant all on *.* to yushan@"%" identified by "123" ;
         mysql>flush privileges; (鍒鋒柊緋葷粺鏉冮檺琛?
       (鎵ц瀹屼細鍦╩ysql.user琛ㄦ彃鍏ヤ竴鏉¤褰曪紝all琛ㄧず鎵鏈夋潈闄?鍖呮嫭澧?鍒?鏀?鏌ョ瓑鏉冮檺)錛?*.* 琛ㄧず鎵鏈夋暟鎹簱錛寉ushan涓烘坊鍔犵殑鐢ㄦ埛鍚嶏紝123涓哄瘑鐮?%涓哄尮閰嶇殑鎵鏈変富鏈猴紝涓婇潰鐨勪俊鎭兘鍙互鎸囧畾濡俫rant select,update on db.* to yushan@localhost identified by '123";)

 

   B.鐩存帴瀵筸ysql.user娣誨姞涓鏉¤褰?/p>

   mysql> insert into mysql.user(Host,User,Password) values("localhost","yusuhan",password("123"));
   mysql>flush privileges;
   榪欐牱灝卞垱寤轟簡涓涓悕涓猴細yushan 瀵嗙爜涓猴細123 (瀵嗙爜鏄粡榪囧姞瀵嗙殑 ) 鐨勭敤鎴鳳紝涓嶈繃榪欐牱娌℃湁鏉冮檺鍥犱負鍙坊鍔犱簡涓変釜瀛楁錛屼篃鍙氳繃grant娣?nbsp; 鍔犳潈闄愶細

   mysql>grant all  on *.* to yushan@localhost identified by '123";
   mysql>flush privileges;(鍒鋒柊緋葷粺鏉冮檺琛?

   錛堣繖縐嶅ソ鍍忔湁鐐瑰暟鍡︿簡銆傜洿鎺ョ敤grant涓嶄箙寰椾簡錛?/p>

 

   娣誨姞瀹岀敤鎴?濡傛灉瑕佽繙紼嬬櫥鍏ySQL,蹇呴』璺熶笂涓繪満Ip 濡備笅錛?/p>

   [root@localhost ~]# mysql -u yushan -p -h 192.168.59.123
   Enter password:(杈撳叆瀵嗙爜)

 

  2.鍒犻櫎鐢ㄦ埛 錛?/p>

   mysql>delete from mysql.user where user ='yushan' ;

   mysql>flush privileges; (鍒鋒柊緋葷粺鏉冮檺琛?

 

  鍏朵粬鐢ㄦ埛鐨勫瘑鐮佷慨鏀逛笌root鐨勪竴鏍鳳紝鍦ㄨ繖閲屾棤璁烘槸娣誨姞鎴栨槸鍒犻櫎鎿嶄綔鍚庡繀欏繪潵涓?span style="color: #008000">flush privileges;榪欐牱鎵嶈兘璧蜂綔鐢ㄧ壒鍒槸鍒犻櫎鐢ㄦ埛鍚庯紝濡傛灉鏈墽琛岋紝琚垹闄ょ殑鐢ㄦ埛榪樺彲鐧誨叆錛屼互涓婇兘鏄湪MySQL root鐢ㄦ埛涓嬫搷浣滐紝涓轟簡MySQL鐨勫畨鍏紝搴旇緇欑敤鎴鋒寚瀹氱浉搴旂殑鏉冮檺

  DROP PROCEDURE IF EXISTS `Sp_SendRequest`;

DELIMITER ;;
CREATE PROCEDURE Sp_SendRequest( 
inRequestID 
Varchar(32),
inRequestTagID 
int(11),
inSendID 
varchar(30),
inOwnerID 
varchar(30)
)
BEGIN
   
set @days := 0;
   
set @timestamps := UNIX_TIMESTAMP();
  
  
select from_unixtime(@timestamps,'%d'into @days;
  
case @days
    
when 1  then  insert into Tbl_FreeGift_01(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 2  then  insert into Tbl_FreeGift_02(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 3  then  insert into Tbl_FreeGift_03(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 4  then  insert into Tbl_FreeGift_04(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 5  then  insert into Tbl_FreeGift_05(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 6  then  insert into Tbl_FreeGift_06(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 7  then  insert into Tbl_FreeGift_07(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 8  then  insert into Tbl_FreeGift_08(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 9  then  insert into Tbl_FreeGift_09(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 10 then  insert into Tbl_FreeGift_10(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 11 then  insert into Tbl_FreeGift_11(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 12 then  insert into Tbl_FreeGift_12(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 13 then  insert into Tbl_FreeGift_13(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 14 then  insert into Tbl_FreeGift_14(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 15 then  insert into Tbl_FreeGift_15(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 16 then  insert into Tbl_FreeGift_16(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 17 then  insert into Tbl_FreeGift_17(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 18 then  insert into Tbl_FreeGift_18(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 19 then  insert into Tbl_FreeGift_19(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 20 then  insert into Tbl_FreeGift_20(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 21 then  insert into Tbl_FreeGift_21(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 22 then  insert into Tbl_FreeGift_22(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 23 then  insert into Tbl_FreeGift_23(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 24 then  insert into Tbl_FreeGift_24(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 25 then  insert into Tbl_FreeGift_25(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 26 then  insert into Tbl_FreeGift_26(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 27 then  insert into Tbl_FreeGift_27(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 28 then  insert into Tbl_FreeGift_28(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 29 then  insert into Tbl_FreeGift_29(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
    
when 30 then  insert into Tbl_FreeGift_30(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps); 
    
when 31 then  insert into Tbl_FreeGift_31(RequestID,RequestTagID,SendID,OwnerID,StartTimeStamp) values(inRequestID,inRequestTagID,inSendID,inOwnerID,@timestamps);
  
  
end case;
  
END;;



]]>
Mysql琛?/title><link>http://www.shnenglu.com/API/archive/2012/03/03/167042.html</link><dc:creator>C++鎶鏈腑蹇?/dc:creator><author>C++鎶鏈腑蹇?/author><pubDate>Sat, 03 Mar 2012 03:35:00 GMT</pubDate><guid>http://www.shnenglu.com/API/archive/2012/03/03/167042.html</guid><wfw:comment>http://www.shnenglu.com/API/comments/167042.html</wfw:comment><comments>http://www.shnenglu.com/API/archive/2012/03/03/167042.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/API/comments/commentRss/167042.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/API/services/trackbacks/167042.html</trackback:ping><description><![CDATA[<div><span style="color: #ff0000; font-size: 18pt;">瀛樺偍寮曟搸鐨勯夋嫨</span></div><br />1. MyISAM涓嶆敮鎸佷簨鍔★紝涓嶆敮鎸佸閿紝浼樼偣鏄闂熷害楂橈紝鎵歸噺鎻掑叆閫熷害蹇傚亣璁懼ぇ閲忕殑鎿嶄綔鏄痵elect銆乮nsert錛屽緩璁噰鐢ㄨ瀛樺偍寮曟搸銆備絾鏄湪鎴戠殑瀹為檯搴旂敤涓紝鍑虹幇榪囨壒閲忔彃鍏ヨ繃浜庨綣佺殑鏃跺欙紝褰撴暟鎹噺鍒拌揪涓瀹氱駭鍒紝鍑虹幇琛ㄦ崯鍧忕殑鎯呭喌銆?br /><br /><div>2. InnoDB鏀寔浜嬪姟澶勭悊錛屼絾鏄浉瀵逛簬鍓嶈咃紝澶勭悊鏁堢巼浣庝竴浜涳紝騫朵笖鍏剁儲寮曞強鏁版嵁涔熸洿鍗犵敤紓佺洏絀洪棿銆傚湪瀛樺偍涓浜涘叧閿暟鎹紝騫墮渶瑕佸鍏惰繘琛屼簨鍔℃搷浣滅殑鏃跺欙紝鎴戜滑鍙互閫夋嫨innodb錛屽綋鐒訛紝鎴戣涓轟粬涓嶅簲璇ユ槸璁塊棶閲忓お澶х殑銆?/div><br /><div><span style="font-size: 18pt; color: #ff0000;">绱㈠紩鐨勮璁″強浣跨敤 </span><p>銆銆鎬庝箞璁捐绱㈠紩鏄悎鐞嗙殑,榪欓噷綆瑕佸垎鏋愪笅绱㈠紩鐨勮璁″強浣跨敤銆?/p> <p>銆銆1. 绱㈠紩閫氬父鏄緗畐here瀛楀彞涓殑鍒楋紝濡傛灉浣犺緗畇elect鍚庣殑鍒楋紝榪欐槸娌℃湁浠諱綍鎰忎箟鐨勩傚綋鐒朵綘闇瑕佸鏌愬垪榪涜鎺掑簭錛宱rder by鍚庣殑鍒椾篃鏄彲浠ュ緩鎴愮儲寮曠殑銆?/p> <p>銆銆2. 浣跨敤鍞竴绱㈠紩錛屼富閿氨鏄渶濂界殑渚嬪瓙錛屽亣璁句綘寤虹殑绱㈠紩鍒楋紝澶ч噺閮芥槸閲嶅鐨勶紝渚嬪錛氭у埆錛岄偅涔堣繖鏍風殑绱㈠紩騫朵笉浼氬姞蹇悳绱㈤熷害銆傝嚦浜庝負浠涔堬紝璇峰ぇ瀹惰嚜琛屼簡瑙g儲寮曠殑宸ヤ綔鍘熺悊銆?/p> <p>銆銆3. 鍙鏈夊彲鑳斤紝灝辮灝介噺闄愬畾绱㈠紩鐨勯暱搴︼紝渚嬪绱㈠紩鍒椾負 char(100)錛屽湪鍏跺墠10涓瓧絎﹀ぇ閮ㄥ垎閮芥槸鍞竴鐨勶紝璇瘋緗儲寮曠殑闀垮害涓?0錛屼嬌鐢ㄧ煭绱㈠紩鍙互鍔犲揩鏌ヨ閫熷害錛屽茍鑺傜渷紜洏絀洪棿銆?/p> <p>銆銆4. 绱㈠紩鐨勫乏鍓嶇紑鐗規э紝鑱斿悎绱㈠紩瀹炶川涓婁篃鏄緩绔嬩簡澶氫釜鐨勭儲寮曪紝閭d箞鏄緩绔嬭仈鍚堢儲寮曞ソ榪樻槸鍒嗗埆寤哄涓儲寮曞ソ鍛紵鏄劇劧鍓嶈呮洿濂斤紝鍒╃敤宸﹀墠緙鐗規э紝鍙鑱斿悎绱㈠紩鐨勬渶宸︾殑鍒楄鐢ㄥ埌錛岄偅涔堢儲寮曢兘浼氳浣跨敤銆?/p> 銆銆5. 褰撶劧錛屾渶鍚庤璇寸殑鏄紝涓嶈榪囧害浣跨敤绱㈠紩錛岀儲寮曡秺澶氾紝鎻掑叆鐨勯熷害瓚婃參錛屽挨鍏跺埌鏁版嵁閲忓簽澶ф椂錛屽悓鏃訛紝澶ч噺鐨勭儲寮曞皢鑰楄垂寰堝紜洏絀洪棿錛岄犳垚涓嶅繀瑕佺殑嫻垂</div><img src ="http://www.shnenglu.com/API/aggbug/167042.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/API/" target="_blank">C++鎶鏈腑蹇?/a> 2012-03-03 11:35 <a href="http://www.shnenglu.com/API/archive/2012/03/03/167042.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>mysql鑾峰彇鏃墮棿鎴?/title><link>http://www.shnenglu.com/API/archive/2012/03/01/166875.html</link><dc:creator>C++鎶鏈腑蹇?/dc:creator><author>C++鎶鏈腑蹇?/author><pubDate>Thu, 01 Mar 2012 07:43:00 GMT</pubDate><guid>http://www.shnenglu.com/API/archive/2012/03/01/166875.html</guid><wfw:comment>http://www.shnenglu.com/API/comments/166875.html</wfw:comment><comments>http://www.shnenglu.com/API/archive/2012/03/01/166875.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/API/comments/commentRss/166875.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/API/services/trackbacks/166875.html</trackback:ping><description><![CDATA[<div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">--</span><span style="color: #008080; "> 灝嗘椂鏈熺敓鎴愭椂闂存埅</span><span style="color: #008080; "><br /></span><span style="color: #0000FF; ">Select</span><span style="color: #000000; "> UNIX_TIMESTAMP(now());<br /></span><span style="color: #0000FF; ">Select</span><span style="color: #000000; "> UNIX_TIMESTAMP(</span><span style="color: #FF0000; ">'</span><span style="color: #FF0000; ">2012-1-1 00:00:00</span><span style="color: #FF0000; ">'</span><span style="color: #000000; ">);<br /><br /></span><span style="color: #008080; ">--</span><span style="color: #008080; "> 灝嗘椂闂存埅杞垚鏃ユ湡鏍煎紡</span><span style="color: #008080; "><br /></span><span style="color: #0000FF; ">select</span><span style="color: #000000; "> from_unixtime(</span><span style="color: #800000; font-weight: bold; ">1330509529</span><span style="color: #000000;">);<br /></span></div><img src ="http://www.shnenglu.com/API/aggbug/166875.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/API/" target="_blank">C++鎶鏈腑蹇?/a> 2012-03-01 15:43 <a href="http://www.shnenglu.com/API/archive/2012/03/01/166875.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍙栧緱鍙楀獎鍝嶈鏁?/title><link>http://www.shnenglu.com/API/archive/2012/02/15/165641.html</link><dc:creator>C++鎶鏈腑蹇?/dc:creator><author>C++鎶鏈腑蹇?/author><pubDate>Wed, 15 Feb 2012 01:35:00 GMT</pubDate><guid>http://www.shnenglu.com/API/archive/2012/02/15/165641.html</guid><wfw:comment>http://www.shnenglu.com/API/comments/165641.html</wfw:comment><comments>http://www.shnenglu.com/API/archive/2012/02/15/165641.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/API/comments/commentRss/165641.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/API/services/trackbacks/165641.html</trackback:ping><description><![CDATA[<div><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">1.閫氳繃浠ヤ笅SQL鍙互鑾峰彇瀵瑰簲鐨剆elect,涓巙pdate delete insert榪斿洖鐨勮鏁幫細</span><br />FOUND_ROWS() : select <br />ROW_COUNT()  : update delete insert</div><br />綆鍗曠ず渚嬶細<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">DROP</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">TABLE</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">IF</span><span style="color: #000000; "> </span><span style="color: #808080; ">EXISTS</span><span style="color: #000000; "> Tbl_MarketLimit;<br /><br /></span><span style="color: #0000FF; ">CREATE</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">TABLE</span><span style="color: #000000; "> Tbl_MarketLimit (<br />  ID     </span><span style="color: #000000; font-weight: bold; ">int</span><span style="color: #000000; "> (</span><span style="color: #800000; font-weight: bold; ">11</span><span style="color: #000000; ">) </span><span style="color: #808080; ">not</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; "> AUTO_INCREMENT,<br />  ItemID </span><span style="color: #000000; font-weight: bold; ">int</span><span style="color: #000000; ">(</span><span style="color: #800000; font-weight: bold; ">11</span><span style="color: #000000; ">) </span><span style="color: #808080; ">NOT</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">NULL</span><span style="color: #000000; ">,<br />  LimitCount </span><span style="color: #000000; font-weight: bold; ">int</span><span style="color: #000000; ">(</span><span style="color: #800000; font-weight: bold; ">11</span><span style="color: #000000; ">) </span><span style="color: #808080; ">not</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; ">,<br />  IsValidate </span><span style="color: #000000; font-weight: bold; ">int</span><span style="color: #000000; ">(</span><span style="color: #800000; font-weight: bold; ">2</span><span style="color: #000000; ">) </span><span style="color: #808080; ">not</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">null</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">default</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">1</span><span style="color: #000000; ">,<br />  </span><span style="color: #0000FF; ">PRIMARY</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">KEY</span><span style="color: #000000; "> (`ID`),<br />  </span><span style="color: #0000FF; ">KEY</span><span style="color: #000000; "> ItemID_index (ItemID)<br />) ENGINE</span><span style="color: #808080; ">=</span><span style="color: #000000; ">InnoDB </span><span style="color: #0000FF; ">DEFAULT</span><span style="color: #000000; "> CHARSET</span><span style="color: #808080; ">=</span><span style="color: #000000; ">utf8;<br /><br /><br /><br /></span><span style="color: #0000FF; ">DROP</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">PROCEDURE</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">IF</span><span style="color: #000000; "> </span><span style="color: #808080; ">EXISTS</span><span style="color: #000000; "> Sp_MarketLimit;<br /><br />DELIMITER ;;<br /></span><span style="color: #0000FF; ">CREATE</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">PROCEDURE</span><span style="color: #000000; "> Sp_MarketLimit( <br />inItemID </span><span style="color: #000000; font-weight: bold; ">int</span><span style="color: #000000; ">(</span><span style="color: #800000; font-weight: bold; ">11</span><span style="color: #000000; ">),<br />inLimitCount </span><span style="color: #000000; font-weight: bold; ">int</span><span style="color: #000000; ">(</span><span style="color: #800000; font-weight: bold; ">11</span><span style="color: #000000; ">)<br />)<br /></span><span style="color: #0000FF; ">BEGIN</span><span style="color: #000000; "><br />  </span><span style="color: #0000FF; ">set</span><span style="color: #000000; "> </span><span style="color: #008000; ">@IsSucc</span><span style="color: #000000; "> </span><span style="color: #808080; ">=</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">0</span><span style="color: #000000; ">;<br />  </span><span style="color: #0000FF; ">update</span><span style="color: #000000; "> Tbl_MarketLimit </span><span style="color: #0000FF; ">set</span><span style="color: #000000; "> LimitCount</span><span style="color: #808080; ">=</span><span style="color: #000000; ">inLimitCount </span><span style="color: #0000FF; ">where</span><span style="color: #000000; "> ItemID</span><span style="color: #808080; ">=</span><span style="color: #000000; ">inItemID </span><span style="color: #808080; ">and</span><span style="color: #000000; "> IsValidate</span><span style="color: #808080; ">=</span><span style="color: #800000; font-weight: bold; ">1</span><span style="color: #000000; ">;<br />  <br />  </span><span style="color: #0000FF; ">select</span><span style="color: #000000; "> ROW_COUNT() </span><span style="color: #0000FF; ">into</span><span style="color: #000000; "> </span><span style="color: #008000; ">@IsSucc</span><span style="color: #000000; ">;<br />  <br />  </span><span style="color: #0000FF; ">if</span><span style="color: #000000; "> </span><span style="color: #008000; ">@IsSucc</span><span style="color: #000000; "> </span><span style="color: #808080; ">=</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">0</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">then</span><span style="color: #000000; "><br />    </span><span style="color: #0000FF; ">insert</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">into</span><span style="color: #000000; "> Tbl_MarketLimit(ItemID,LimitCount) </span><span style="color: #0000FF; ">values</span><span style="color: #000000; ">(inItemID,inLimitCount);<br />  </span><span style="color: #0000FF; ">end</span><span style="color: #000000; "> </span><span style="color: #0000FF; ">if</span><span style="color: #000000; ">;<br /></span><span style="color: #0000FF; ">END</span><span style="color: #000000; ">;;<br /><br /><br /><br /></span></div><img src ="http://www.shnenglu.com/API/aggbug/165641.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/API/" target="_blank">C++鎶鏈腑蹇?/a> 2012-02-15 09:35 <a href="http://www.shnenglu.com/API/archive/2012/02/15/165641.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Mysql琛ㄧ粨鏋勬搷浣?/title><link>http://www.shnenglu.com/API/archive/2011/07/05/150179.html</link><dc:creator>C++鎶鏈腑蹇?/dc:creator><author>C++鎶鏈腑蹇?/author><pubDate>Tue, 05 Jul 2011 01:05:00 GMT</pubDate><guid>http://www.shnenglu.com/API/archive/2011/07/05/150179.html</guid><wfw:comment>http://www.shnenglu.com/API/comments/150179.html</wfw:comment><comments>http://www.shnenglu.com/API/archive/2011/07/05/150179.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/API/comments/commentRss/150179.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/API/services/trackbacks/150179.html</trackback:ping><description><![CDATA[<div class="bxpfvbh" id="cnblogs_post_body"> <p>ALTER TABLE錛氭坊鍔狅紝淇敼錛屽垹闄よ〃鐨勫垪錛岀害鏉熺瓑琛ㄧ殑瀹氫箟銆?/p> <ul><li>鏌ョ湅鍒楋細desc 琛ㄥ悕;</li><li>淇敼琛ㄥ悕錛歛lter table t_book rename to bbb;</li><li>娣誨姞鍒楋細alter table 琛ㄥ悕 add column 鍒楀悕 varchar(30);</li><li>鍒犻櫎鍒楋細alter table 琛ㄥ悕 drop column 鍒楀悕;</li><li>淇敼鍒楀悕MySQL錛?alter table bbb change nnnnn hh int;</li><li>淇敼鍒楀悕SQLServer錛歟xec sp_rename't_student.name','nn','column';</li><li>淇敼鍒楀悕Oracle錛歭ter table bbb rename column nnnnn to hh int;</li><li>淇敼鍒楀睘鎬э細alter table t_book modify name varchar(22); </li></ul> <p>sp_rename錛歋QLServer 鍐呯疆鐨勫瓨鍌ㄨ繃紼嬶紝鐢ㄤ笌淇敼琛ㄧ殑瀹氫箟銆?/p></div><img src ="http://www.shnenglu.com/API/aggbug/150179.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/API/" target="_blank">C++鎶鏈腑蹇?/a> 2011-07-05 09:05 <a href="http://www.shnenglu.com/API/archive/2011/07/05/150179.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.87666.com.cn" target="_blank">男女久久久国产一区二区三区</a>| <a href="http://www.fc-lawyer.cn" target="_blank">久久国产免费观看精品</a>| <a href="http://www.bddp.com.cn" target="_blank">国产精品成人无码久久久久久</a>| <a href="http://www.jejf.cn" target="_blank">久久99国产综合精品免费</a>| <a href="http://www.tmnv.cn" target="_blank">狠狠色丁香久久婷婷综合五月 </a>| <a href="http://www.nt52.cn" target="_blank">亚洲AV成人无码久久精品老人</a>| <a href="http://www.csffh.cn" target="_blank">人妻少妇久久中文字幕一区二区 </a>| <a href="http://www.vcyw.cn" target="_blank">欧美日韩精品久久免费</a>| <a href="http://www.ssc905.cn" target="_blank">波多野结衣久久一区二区</a>| <a href="http://www.ahsxd.org.cn" target="_blank">久久精品无码一区二区无码</a>| <a href="http://www.g8360.cn" target="_blank">久久久国产精品</a>| <a href="http://www.ha9hpn.cn" target="_blank">亚洲AV无一区二区三区久久</a>| <a href="http://www.awxsp.cn" target="_blank">久久996热精品xxxx</a>| <a href="http://www.shawcai.cn" target="_blank">日本强好片久久久久久AAA</a>| <a href="http://www.udyq.cn" target="_blank">久久国产精品偷99</a>| <a href="http://www.yghzby.cn" target="_blank">久久久久亚洲精品天堂久久久久久 </a>| <a href="http://www.gg4493.cn" target="_blank">色欲av伊人久久大香线蕉影院</a>| <a href="http://www.qdtiandiyuan.cn" target="_blank">亚洲国产日韩欧美久久</a>| <a href="http://www.fcks.net.cn" target="_blank">亚洲国产天堂久久综合</a>| <a href="http://www.liuxuehanguo.cn" target="_blank">久久久久一本毛久久久</a>| <a href="http://www.hkgsjt.cn" target="_blank">久久人人爽人人爽人人片AV东京热</a>| <a href="http://www.summernote.cn" target="_blank">国产精品欧美亚洲韩国日本久久</a>| <a href="http://www.orionstaros.cn" target="_blank">中文字幕一区二区三区久久网站 </a>| <a href="http://www.caifu580.cn" target="_blank">精品久久久久久无码人妻蜜桃</a>| <a href="http://www.08fq.cn" target="_blank">国产福利电影一区二区三区久久久久成人精品综合 </a>| <a href="http://www.zenavo.cn" target="_blank">无码AV波多野结衣久久</a>| <a href="http://www.52cxw.cn" target="_blank">久久亚洲国产成人影院网站</a>| <a href="http://www.netcacd.cn" target="_blank">久久久久亚洲AV无码专区网站</a>| <a href="http://www.jumingyang.cn" target="_blank">精品久久久久久无码人妻热</a>| <a href="http://www.emkx1.cn" target="_blank">国产精品久久久久久五月尺</a>| <a href="http://www.peizis.cn" target="_blank">久久夜色精品国产亚洲</a>| <a href="http://www.zzhysh.cn" target="_blank">伊人久久大香线蕉综合网站</a>| <a href="http://www.jinshengsuliao.cn" target="_blank">亚洲中文字幕无码一久久区</a>| <a href="http://www.51keepruning.cn" target="_blank">国产日产久久高清欧美一区</a>| <a href="http://www.hyly168.com.cn" target="_blank">久久996热精品xxxx</a>| <a href="http://www.hzks666.cn" target="_blank">久久久久亚洲av综合波多野结衣</a>| <a href="http://www.hm661.cn" target="_blank">久久99精品久久久久婷婷</a>| <a href="http://www.xiezongjun.cn" target="_blank">蜜桃麻豆www久久</a>| <a href="http://www.mx3g.cn" target="_blank">综合网日日天干夜夜久久</a>| <a href="http://www.rentieyou.cn" target="_blank">国产精品一区二区久久国产</a>| <a href="http://www.sztaoren.cn" target="_blank">久久久精品视频免费观看</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>