??xml version="1.0" encoding="utf-8" standalone="yes"?>国产午夜电影久久,久久精品成人免费看,国产无套内射久久久国产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.d|下载http://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.在mysql-5.7.10-winx64目录下,新徏一个my.ini。复制下面的代码保存可以了(jin)?/span>
[mysql]
; 讄mysql客户端默认字W集
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
; 服务端用的字符集默认ؓ(f)8比特~码的latin1字符?/span>
character-set-server=utf8
; 创徏新表时将使用的默认存储引?/span>
default-storage-engine=MYISAM
3.在win下以理员n份运行cmd
4.在bin目录下,q行>mysqld install
5.然后q行>mysqld  --initialize
  q个初始化操作将my.ini中的datadir目录下生成数据库文gQ也可以该里面的文件全删除。重新输入该命o(h)初始?br />6.启动服务>net start mysql
7. 修改密码

打开MySQL/bin目录下输入mysql -uroot -p ,默认是没有密码的Q一般是直接按回车进入,但是?x)出?/span>
ERROR 1045 (28000): Access denied for user'root'@'localhost'(using password: YES)的错??/span>
解决的方法都是在在配|文件[mysqld]条目下加一条命令skip-grant-tables然后重启服务可以略q密码进入了(jin)?/span>

在cmd里面输入mysql -u root-p可以不用密码登录了(jin)Q出现passwordQ的时候直接回车可以进入,不会(x)出现ERROR 1045(28000)Q但很多操作都会(x)受限Ӟ因ؓ(f)没有不能grantQ没有权限)(j)的密?/span>

(1).q入mysql数据库:(x)

mysql> use mysql;Database changed

(2).lroot用户讄新密码mysql> 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).h数据?nbsp;Q一定要记得hQmysql>flush privileges; QueryOK, 0 rows affected (0.00 sec)

(4).退出mysqlQmysql> quit

最后把配置文g中的skip-grant-tables 注释掉。下ơ输入mysql -uroot -p 可以用新密码登录了(jin)
8.如果再次q入输入 >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?Q?的分别只保留两条
3.新徏一个(f)时表Q字D同上,q新增一个num字段增。ƈ插入
insert into t_tmp(id,value) select id,value from t_value order by id;
4.于是t_tmp如下Q?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 |
+----+----------+-----+


]]>
mysqlpȝ表prochttp://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.在系l表proc中的definer字段用来理存储q程的访问权?/div>

]]>
mysql导出表结构与存储q程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 从from_base 转换?to_baseQƈ以字W串形式q回。如果Q何一个参Cؓ(f) NULLQ那么返回g?NULL。参?N 被解释ؓ(f)是一个整敎ͼ但是也可以被指定Z个整数或一个字W串。最基?2Q最大基?36。如?to_base 是一个负|N 被看作为是一个有W号数字。否则,N 被视为是无符L(fng)。CONV ?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中插入中文报错:(x)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_%';

最q向QyQIQ数据库插入数据时出C(jin)一个问题,报告中文错误Qincorrect string value Q.Q.Q在|上搜了(jin)一些资料也都是宽泛的说_(d)自己l合各家之长Q试?jin)试Q发现把数据库编码、页面编码和Qava文g~码修改成统一的编码方案就行了(jin)?/span>

 在݋ySQL命o(h)H口下输入\s就可以查看当前数据库的~码?jin)?/span>

 修改Ҏ(gu)

面和Java文g中的修改׃说了(jin)Q大家肯定都?x),只说说怎样修改MySQL的吧?/span>

修改数据库编码的命o(h)是:(x)ALTER DATABASE `test` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin

 修改表的~码的命令是QALTER TABLE `category` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin

 修改表中字段的编码的命o(h)是:(x)ALTER TABLE `test` CHANGE `dd` `dd` VARCHAR( 45 ) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL

修改MySQL默认~码Ҏ(gu)Q在windows环境?/strong>可以直接用Mysql Server Instance Config Wizard q行讄

Linux环境?/strong>

/etc/init.d/mysql start (stop) 为启动和停止服务?/span>

  /etc/mysql/ 主要配置文g所在位|?my.cnf

  /var/lib/mysql/ 攄的是数据库表文g夹,q里的mysql相当于windows下mysql的date文g?/p>

  启动mysql后,以rootdmysql

  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/ |

  +--------------------------+----------------------------+

  在某些时候,我们l要修改mysql默认数据库的~码Q以保证某些q移的程序可以正常显C,~辑my.cnf文gq行~码修改,windows可以直接用Mysql Server Instance Config Wizard q行讄

  在linux下修?个my.cnf??etc/mysql/my.cnf文g

  扑ֈ客户端配|[client] 在下面添?/p>

  default-character-set=utf8 默认字符集ؓ(f)utf8

  在找到[mysqld] d

  default-character-set=utf8 默认字符集ؓ(f)utf8

  init_connect='SET NAMES utf8' (讑֮q接mysql数据库时使用utf8~码Q以让mysql数据库ؓ(f)utf8q行)

  修改好后Q重新启动mysql 卛_Q查询一下show 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/ |

  +--------------------------+----------------------------+

  此方法用于标准mysql版本同样有效Q对?etc/my.cnf文gQ需要从mysql/support-files的文件夹cp my-large.cnf一份到/etc/my.cnf?/p>

]]>
扚w修改表引?/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是否有充H?br />2. 删除数据Ӟ不要使用delete from tbl where fd1 in(select fb1 from tb2);q样的句释,应该使用<br />   delete tb1 from tb1,tb2 where tb1.fd1 = tb2.fd1;<br /><br />3.在合数据Ӟ注意存储q程的可再入性,卻I已经合过的̎号信息,应该注意标记Q以免意外情冉|断时<br />   可以l箋(hu)执行存储q程?br /><br />4.如果一个存储过E合q比较复杂,账号信息多,注意用取模的方式分开执行。比如分10ơ,或者更多次数去执行合ƈ存储q程?br />    如果N条SQL可以开多个l端分开同时执行?br /><br />5.注意在非常耗时的存储过E中Q加入执行进度,可以x(chng)知道执行情况?/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删除多表数据Q怎样才能同时删除多个兌表的数据呢?q里做了(jin)深入的解释:(x)
1 delete from t1 where 条g
2 delete t1 from t1 where 条g
3 delete t1 from t1,t2 where 条g
4 delete t1,t2 from t1,t2 where 条g


?3者是可行的,W?者不可行?br />也就是简单用delete语句无法q行多表删除数据操作Q不q可以徏立联删除,在两个表之间建立U联删除关系Q则可以实现删除一个表的数据时Q同时删除另一个表中相关的数据?br />
1、从数据表t1中把那些id值在数据表t2里有匚w的记录全删除? DELETE t1 FROM t1,t2 WHERE t1.id=t2.id ?DELETE FROM t1 USING t1,t2 WHERE t1.id=t2.id


2、从数据表t1里在数据表t2里没有匹配的记录查找出来q删除掉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?从两个表中找出相同记录的数据q把两个表中的数据都删除? DELETE t1,t2 from t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t1.id=25


注意此处的delete t1,t2 from 中的t1,t2不能是别?br />
如:(x)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中是可以的)(j)

上述语句?写成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中是可以的)(j)


]]>
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 的innodb优化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    看来也许你忘?sh)(jin)修改这个参C(jin)?br />          默认值是 1Q这意味着每次提交的更C务(或者每个事务之外的语句Q都?x)刷新到盘(sh),而这相当耗费资源Q尤其是没有甉|备用~存时?br />                         很多应用E序Q尤其是?MyISAM转变q来的那些,把它的D|ؓ(f) 2 可以了(jin)Q也是不把日志h到磁盘(sh)Q而只h到操
                         作系l的~存?sh)。日志仍然会(x)每秒h到磁盘(sh)去,因此通常不会(x)丢失每秒1-2ơ更新的消耗。如果设|ؓ(f) 0 快很多?jin),不过?br />                         相对不安全了(jin)。MySQL服务器崩溃时׃(x)丢失一些事务。设|ؓ(f) 2 指挥丢失h到操作系l缓存的那部分事务?img src ="http://www.shnenglu.com/API/aggbug/185629.html" width = "1" height = "1" />

]]>
Mysql另一U插入语?如果唯一冲突,则不插入,执行更新)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中是否能有SQLserver的@@error变量呢,或者如c#中的try catch语法呢?nbsp; 

{案是肯定的Q实例代码如下:(x)*
*/
  


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;  

     

/**语句Q?nbsp; 

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

 作用是当遇到SQLEXCEPTION,SQLWARNING,NOT FOUND 错误Ӟ讄_err=1q执行CONTINUE操作Q即l箋(hu)执行后面的语句?nbsp; 

 q就与cQ中的try catch语法很像?nbsp; 

而且在执行可能出错的语句的时候我们用事务语句QSTART 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Ҏ(gu)1
mysql -uuser -ppasswd -e"insert LogTable values()"  

优点Q语句简?/div>
~点Q支持的sql相对?/div>

Ҏ(gu)2

准备一个sql脚本Q名字ؓ(f)update.sqlQ例如:(x)
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 'q龄',  
  
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='讉K日志';  

新徏一个update_mysql.shQ内容如下:(x)
use chbdb;  
source update.sql

然后执行如下命o(h)Q?br />
cat update_mysql.sh | mysql --user=root -ppassword  

优点Q支持复杂的sql脚本
~点Q?/strong>
1> 需要两个文Ӟ(x)update.sql和update_mysql.sh
2> 一旦中间出错,之后脚本׃?x)执行,例如Q?/span>
如果W一张表已经存在Q则?x)报出如下异常?x)
ERROR 1050 (42S01) at line 1 in file: 'update.sql': Table 'user' already exists
然后脚本退出,W二张表也就无法创徏?/span>


Ҏ(gu)3
新徏一个shell脚本Q格式如下:(x)
#!/bin/bash   
mysql -u* -h* -p* <<EOF  
Your SQL script.  
EOF  

优点Q?/strong>
1>支持复杂的sql脚本
2>无需其它额外文g
~点Q?/strong>
1> 表名、字D不能用单引号Q需要修改原有sql语句
2> 一旦中间出错,之后脚本׃?x)执行,例如Q?/span>
如果W一张表已经存在Q则?x)报出如下异常?x)
ERROR 1050 (42S01) at line 1 in file: 'update.sql': Table 'user' already exists
然后脚本退出,W二张表也就无法创徏?/span>


Ҏ(gu)4
准备一个sql脚本Q如update.sqlQ然后执行如下命令:(x)

mysql -uroot -ppassword < update.sql  

优点Q?span style="font-weight: normal">支持复杂的sql脚本
~点Q?/strong>
1> 一旦中间出错,之后脚本׃?x)执行,例如Q?/span>
如果W一张表已经存在Q则?x)报出如下异常?x)
ERROR 1050 (42S01) at line 1 in file: 'update.sql': Table 'user' already exists
然后脚本退出,W二张表也就无法创徏?/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

一、root用户密码的维护:(x)

       ׃安装MySQL完后,MySQL?x)自动提供一个不带密码的root用户Qؓ(f)?jin)安全v见给root讄密码Q?/p>

       #mysqladmin -u root password 123 (123为密码,也可以写?'123'?123") Q?/p>

       讄密码后登入时׃能直接输入mysql?jin),必须跟些参数?如下Q?/p>

       [root@localhost ~]# mysql -u root -p Q?u 后跟d的用户名Q?p 提示要密码登入)(j)
       Enter password:(输入密码)

 

       修改密码Q?/p>

       [root@localhost ~] #mysqladmin -u root  -p  password  123456 (password 后跟的是要更新的新密?
       Enter password:(输入原始密码Q回车即?

 

二、其他用L(fng)增加和删除:(x)

      以root用户dQ在mysql中有一张mysql.user表是存储MySQL中所有用L(fng)信息表,所以可以直接增加删除这个表的记录就可增加和删除用户Q?/p>

 

     1.d用户Q有两种形式Q:(x)

       A.mysql> grant all on *.* to yushan@"%" identified by "123" ;
         mysql>flush privileges; (hpȝ权限?
       (执行完会(x)在mysql.user表插入一条记录,all表示所有权?包括???查等权限)Q?*.* 表示所有数据库Qyushan为添加的用户名,123为密?%为匹配的所有主机,上面的信息都可以指定如grant select,update on db.* to yushan@localhost identified by '123";)

 

   B.直接对mysql.userd一条记?/p>

   mysql> insert into mysql.user(Host,User,Password) values("localhost","yusuhan",password("123"));
   mysql>flush privileges;
   q样创Z(jin)一个名为:(x)yushan 密码为:(x)123 (密码是经q加密的 ) 的用P不过q样没有权限因ؓ(f)只添加了(jin)三个字段Q也可通过grant?nbsp; 加权限:(x)

   mysql>grant all  on *.* to yushan@localhost identified by '123";
   mysql>flush privileges;(hpȝ权限?

   Q这U好像有点啰嗦了(jin)。直接用grant不久得了(jin)Q?/p>

 

   d完用?如果要远E登入MySQL,必须跟上LIp 如下Q?/p>

   [root@localhost ~]# mysql -u yushan -p -h 192.168.59.123
   Enter password:(输入密码)

 

  2.删除用户 Q?/p>

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

   mysql>flush privileges; (hpȝ权限?

 

  其他用户的密码修改与root的一P在这里无论是d或是删除操作后必L?span style="color: #008000">flush privileges;q样才能起作用特别是删除用户后,如果未执行,被删除的用户q可dQ以上都是在MySQL root用户下操作,Z(jin)MySQL的安全,应该l用h定相应的权限

  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不支持事务,不支持外键,优点是访问速度高,扚w插入速度快。假讑֤量的操作是select、insertQ徏议采用该存储引擎。但是在我的实际应用中,出现q批量插入过于频J的时候,当数据量到达一定别,出现表损坏的情况?br /><br /><div>2. InnoDB支持事务处理Q但是相对于前者,处理效率低一些,q且其烦(ch)引及(qing)数据也更占用盘I间。在存储一些关键数据,q要对其进行事务操作的时候,我们可以选择innodbQ当?dng)我认Z不应该是讉K量太大的?/div><br /><div><span style="font-size: 18pt; color: #ff0000;">索引的设计及(qing)使用 </span><p>  怎么设计索引是合理的,q里要分析下索引的设计及(qing)使用?/p> <p>  1. 索引通常是设|where字句中的列,如果你设|select后的列,q是没有M意义的。当然你需要对某列q行排序Qorder by后的列也是可以徏成烦(ch)引的?/p> <p>  2. 使用唯一索引Q主键就是最好的例子Q假设你建的索引列,大量都是重复的,例如Q性别Q那么这L(fng)索引q不?x)加快搜索速度。至于ؓ(f)什么,请大家自行了(jin)解烦(ch)引的工作原理?/p> <p>  3. 只要有可能,p量限定索引的长度,例如索引列ؓ(f) char(100)Q在其前10个字W大部分都是唯一的,误|烦(ch)引的长度?0Q用短索引可以加快查询速度Qƈ节省盘I间?/p> <p>  4. 索引的左前缀Ҏ(gu),联合索引实质上也是徏立了(jin)多个的烦(ch)引,那么是徏立联合烦(ch)引好q是分别建多个烦(ch)引好呢?昄前者更好,利用左前~Ҏ(gu),只要联合索引的最左的列被用到Q那么烦(ch)引都?x)被使用?/p>   5. 当然Q最后要说的是,不要q度使用索引Q烦(ch)引越多,插入的速度慢Q尤其到数据量庞大时Q同Ӟ大量的烦(ch)引将耗费很多盘I间Q造成不必要的费</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>取得受媄(jing)响行?/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可以获取对应的select,与update delete insertq回的行敎ͼ(x)</span><br />FOUND_ROWS() : select <br />ROW_COUNT()  : update delete insert</div><br />单示例:(x)<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="vyvhtns" id="cnblogs_post_body"> <p>ALTER TABLEQ添加,修改Q删除表的列Q约束等表的定义?/p> <ul><li>查看列:(x)desc 表名;</li><li>修改表名Qalter table t_book rename to bbb;</li><li>d列:(x)alter table 表名 add column 列名 varchar(30);</li><li>删除列:(x)alter table 表名 drop column 列名;</li><li>修改列名MySQLQ?alter table bbb change nnnnn hh int;</li><li>修改列名SQLServerQexec sp_rename't_student.name','nn','column';</li><li>修改列名OracleQlter table bbb rename column nnnnn to hh int;</li><li>修改列属性:(x)alter table t_book modify name varchar(22); </li></ul> <p>sp_renameQSQLServer 内置的存储过E,用与修改表的定义?/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.theboy.com.cn" target="_blank">AAƬѿƵþ</a>| <a href="http://www.sdlove.cn" target="_blank">þۺϸϾþúݺݺ97ɫ69</a>| <a href="http://www.qi-pin.cn" target="_blank">66ƷۺϾþþþþþ</a>| <a href="http://www.020xyk.cn" target="_blank">91Ʒþþþþ91</a>| <a href="http://www.material7.cn" target="_blank">ŷþۺ</a>| <a href="http://www.ndj2.cn" target="_blank">ھƷþþþþþþ</a>| <a href="http://www.68360.cn" target="_blank">þwww˳_Ƭ</a>| <a href="http://www.fuzd88.cn" target="_blank">鶹һ99þþþ</a>| <a href="http://www.jamesauto.cn" target="_blank">ԭ1769þѲ</a>| <a href="http://www.axtea2007.cn" target="_blank">ŷaƬѿþ</a>| <a href="http://www.lar6ge.cn" target="_blank">һɫþۺϺݺ</a>| <a href="http://www.ilxq.cn" target="_blank">91þó</a>| <a href="http://www.fjprxr.cn" target="_blank">˾þۺ</a>| <a href="http://www.norid.cn" target="_blank">˾þں2019</a>| <a href="http://www.saxie.cn" target="_blank">ݺɫþۺѿ </a>| <a href="http://www.lolzk.cn" target="_blank">99þþþƷѹۿ</a>| <a href="http://www.sywanfu.cn" target="_blank">þ99Ʒ鶹</a>| <a href="http://www.f4home.cn" target="_blank">һɫþ88Ʒۺ</a>| <a href="http://www.5qzone.cn" target="_blank">Ʒ99þþþ91gav</a>| <a href="http://www.hetiandai.cn" target="_blank">RE99þþƷ66</a>| <a href="http://www.xiaomaidou.cn" target="_blank">Ʒþþ</a>| <a href="http://www.lntyyp.cn" target="_blank">޹˾Ʒ91þþ</a>| <a href="http://www.waterbirds.cn" target="_blank">97þþþ</a>| <a href="http://www.icrms.org.cn" target="_blank">þۺ77777</a>| <a href="http://www.54wk.cn" target="_blank">ձƬҹþ</a>| <a href="http://www.facpw.cn" target="_blank">˾Ʒþ</a>| <a href="http://www.smegdmm.cn" target="_blank">þƵ6</a>| <a href="http://www.hdmi-cable.cn" target="_blank">ŮдþӰԺ</a>| <a href="http://www.egpk.cn" target="_blank">պ뾫Ʒþһ</a>| <a href="http://www.netbirds.cn" target="_blank">þԾƷ</a>| <a href="http://www.t5573.cn" target="_blank">˾þþƷ</a>| <a href="http://www.panroad.cn" target="_blank">þþƷ鶹ҹҹ</a>| <a href="http://www.0546bbs.cn" target="_blank">ŷҹͽþþ </a>| <a href="http://www.txt115.cn" target="_blank">þþƷ</a>| <a href="http://www.360shouji.net.cn" target="_blank">97þþƷһ</a>| <a href="http://www.commonsoft.cn" target="_blank">þþùҺ</a>| <a href="http://www.qhsy217.cn" target="_blank">ŷͽxxxxѿþþ</a>| <a href="http://www.ter2.cn" target="_blank">ѹ99þþ㽶</a>| <a href="http://www.gpfo.cn" target="_blank">þerƷѹۿ2</a>| <a href="http://www.rainbow-city.cn" target="_blank">vaþþþ</a>| <a href="http://www.ezchem.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>