﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-自由飞翔-随笔分类-mysql</title><link>http://www.blogjava.net/GavinMiao/category/49314.html</link><description>我在仰望，java之上</description><language>zh-cn</language><lastBuildDate>Mon, 12 Dec 2011 11:06:36 GMT</lastBuildDate><pubDate>Mon, 12 Dec 2011 11:06:36 GMT</pubDate><ttl>60</ttl><item><title>mysql设置编码格式</title><link>http://www.blogjava.net/GavinMiao/archive/2011/12/01/365331.html</link><dc:creator>GavinMiao</dc:creator><author>GavinMiao</author><pubDate>Thu, 01 Dec 2011 13:52:00 GMT</pubDate><guid>http://www.blogjava.net/GavinMiao/archive/2011/12/01/365331.html</guid><wfw:comment>http://www.blogjava.net/GavinMiao/comments/365331.html</wfw:comment><comments>http://www.blogjava.net/GavinMiao/archive/2011/12/01/365331.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/GavinMiao/comments/commentRss/365331.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/GavinMiao/services/trackbacks/365331.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="font-family: simsun; line-height: 23px; background-color: #ffffff; "><div>ALTER DATABASE `databasename` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci</div></span><span class="Apple-style-span" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px; background-color: #ffffff; ">ALTER TABLE `tableName` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci<br /></span><span class="Apple-style-span" style="font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 15px; background-color: #ffffff; ">ALTER TABLE `tableName` CHANGE `dd` `dd` VARCHAR( 45 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL&nbsp;<br /></span><span class="Apple-style-span" style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff; ">create table（）ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='哈喽啦'</span><span class="Apple-style-span" style="font-family: simsun; line-height: 23px; background-color: #ffffff; "><br />show variables like 'collation_%';<br /></span><span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: #f7fcff; ">SHOW VARIABLES LIKE 'character%';<br /></span><span class="Apple-style-span" style="color: #333333; font-family: Arial, Tahoma, Verdana, sans-serif; line-height: 25px; background-color: #f7fcff; ">SET character_set_client = utf8 ;&nbsp;<br /></span><div>set character_set_server = utf8;<br /><div>set&nbsp;character_set_connection&nbsp;= utf8;<br /><div>set&nbsp;character_set_database&nbsp;= utf8;<br /><div>set&nbsp;character_set_results&nbsp;= utf8;<br /><div>set&nbsp;character_set_system&nbsp;= utf8;<br /><div><br /><span class="Apple-style-span" style="color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">set collation_connection='utf8_general_ci';</span><br /><font class="Apple-style-span" color="#333333" face="宋体"><span class="Apple-style-span" style="line-height: 28px;"></span></font><span class="Apple-style-span" style="color: #333333; font-family: 宋体; line-height: 28px; background-color: #ffffff; ">set collation_database=<div style="display: inline-block; "></div></span><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif, SimSun; line-height: 22px; background-color: #ffffff; ">'utf8_general_ci';<br /></span><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif, SimSun; line-height: 22px; background-color: #ffffff; ">set collation_server='utf8_general_ci';</span></div></div></div></div></div></div><img src ="http://www.blogjava.net/GavinMiao/aggbug/365331.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/GavinMiao/" target="_blank">GavinMiao</a> 2011-12-01 21:52 <a href="http://www.blogjava.net/GavinMiao/archive/2011/12/01/365331.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>mysql重启命令</title><link>http://www.blogjava.net/GavinMiao/archive/2011/12/01/365330.html</link><dc:creator>GavinMiao</dc:creator><author>GavinMiao</author><pubDate>Thu, 01 Dec 2011 13:20:00 GMT</pubDate><guid>http://www.blogjava.net/GavinMiao/archive/2011/12/01/365330.html</guid><wfw:comment>http://www.blogjava.net/GavinMiao/comments/365330.html</wfw:comment><comments>http://www.blogjava.net/GavinMiao/archive/2011/12/01/365330.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/GavinMiao/comments/commentRss/365330.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/GavinMiao/services/trackbacks/365330.html</trackback:ping><description><![CDATA[<div>/etc/rc.d/init.d/mysql restart&nbsp;<br /></div><img src ="http://www.blogjava.net/GavinMiao/aggbug/365330.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/GavinMiao/" target="_blank">GavinMiao</a> 2011-12-01 21:20 <a href="http://www.blogjava.net/GavinMiao/archive/2011/12/01/365330.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>rpm及liunx下mysql安装及卸载</title><link>http://www.blogjava.net/GavinMiao/archive/2011/12/01/365283.html</link><dc:creator>GavinMiao</dc:creator><author>GavinMiao</author><pubDate>Thu, 01 Dec 2011 05:24:00 GMT</pubDate><guid>http://www.blogjava.net/GavinMiao/archive/2011/12/01/365283.html</guid><wfw:comment>http://www.blogjava.net/GavinMiao/comments/365283.html</wfw:comment><comments>http://www.blogjava.net/GavinMiao/archive/2011/12/01/365283.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/GavinMiao/comments/commentRss/365283.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/GavinMiao/services/trackbacks/365283.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;只有注册用户登录后才能阅读该文。<a href='http://www.blogjava.net/GavinMiao/archive/2011/12/01/365283.html'>阅读全文</a><img src ="http://www.blogjava.net/GavinMiao/aggbug/365283.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/GavinMiao/" target="_blank">GavinMiao</a> 2011-12-01 13:24 <a href="http://www.blogjava.net/GavinMiao/archive/2011/12/01/365283.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>mysql导入导出表结构及表数据及执行sql文件</title><link>http://www.blogjava.net/GavinMiao/archive/2011/11/22/364499.html</link><dc:creator>GavinMiao</dc:creator><author>GavinMiao</author><pubDate>Tue, 22 Nov 2011 02:54:00 GMT</pubDate><guid>http://www.blogjava.net/GavinMiao/archive/2011/11/22/364499.html</guid><wfw:comment>http://www.blogjava.net/GavinMiao/comments/364499.html</wfw:comment><comments>http://www.blogjava.net/GavinMiao/archive/2011/11/22/364499.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/GavinMiao/comments/commentRss/364499.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/GavinMiao/services/trackbacks/364499.html</trackback:ping><description><![CDATA[<span class="Apple-style-span" style="color: #333333; font-family: tahoma, arial, 宋体, sans-serif; background-color: #ffffff; ">在mysql中执行sql文件的命令</span><span class="Apple-style-span" style="color: #333333; font-family: tahoma, arial, 宋体, sans-serif; background-color: #ffffff; ">&nbsp;:&nbsp;source&nbsp; d:\myprogram\database\db.sql;<br /></span><span class="Apple-style-span" style="color: #333333; font-family: tahoma, arial, 宋体, sans-serif; background-color: #ffffff; ">连接MYSQL:<div style="display: inline-block; "></div></span><span class="Apple-style-span" style="color: #333333; font-family: tahoma, arial, 宋体, sans-serif; background-color: #ffffff; "><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 'courier new', courier, monospace; ">mysql -h主机地址 -u用户名 －p用户密码<br /></pre></span><span class="Apple-style-span" style="color: #333333; font-family: tahoma, arial, 宋体, sans-serif; background-color: #ffffff; ">修改密码：<br /></span><span class="Apple-style-span" style="color: #333333; font-family: tahoma, arial, 宋体, sans-serif; background-color: #ffffff; "><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 'courier new', courier, monospace; ">mysqladmin -u用户名 -p旧密码 password 新密码<br /></pre></span><span class="Apple-style-span" style="color: #333333; font-family: 宋体; line-height: 28px; background-color: #f8f8f8; "><strong style="font-weight: bold; text-align: center; "></strong></span><span class="Apple-style-span" style="color: #333333; font-family: 宋体; line-height: 28px; background-color: #f8f8f8; "><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "><strong style="font-weight: bold; text-align: center; ">从数据库导出数据库文件：</strong></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">1.将数据库mydb导出到e:\MySQL\mydb.sql文件中：</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">打开开始-&gt;运行-&gt;输入cmd 进入命令行模式</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "></p><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "><ol class="dp-xml" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "><li class="alt" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; ">c:\</span><span class="tag" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 7px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; width: 635px; line-height: 18px; font-weight: bold; ">&gt;</span></span>MySQLdump&nbsp;-h&nbsp;localhost&nbsp;-u&nbsp;root&nbsp;-p&nbsp;mydb&nbsp;&gt;e:\MySQL\mydb.sql&nbsp;</li></ol></pre><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">然后输入密码，等待一会导出就成功了，可以到目标文件中检查是否成功。</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">2.将数据库mydb中的mytable导出到e:\MySQL\mytable.sql文件中：</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "></p><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "><ol class="dp-xml" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "><li class="alt" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; ">c:\</span><span class="tag" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 7px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; width: 635px; line-height: 18px; font-weight: bold; ">&gt;</span></span>MySQLdump&nbsp;-h&nbsp;localhost&nbsp;-u&nbsp;root&nbsp;-p&nbsp;mydb&nbsp;mytable&gt;e:\MySQL\mytable.sql&nbsp;</li></ol></pre><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">3.将数据库mydb的结构导出到e:\MySQL\mydb_stru.sql文件中：</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "></p><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "><ol class="dp-xml" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "><li class="alt" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; ">c:\</span><span class="tag" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 7px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; width: 635px; line-height: 18px; font-weight: bold; ">&gt;</span></span>MySQLdump&nbsp;-h&nbsp;localhost&nbsp;-u&nbsp;root&nbsp;-p&nbsp;mydb&nbsp;--add-drop-table&nbsp;&gt;e:\MySQL\mydb_stru.sql&nbsp;</li></ol></pre><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">-h localhost可以省略，其一般在虚拟主机上用</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "><strong style="font-weight: bold; text-align: center; ">四.从外部文件MySQL导入数据到数据库中：</strong></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">从e:\MySQL\mydb2.sql中将文件中的SQL语句导入数据库中：</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">1.从命令行进入MySQL，然后用命令CREATE DATABASE mydb2;创建数据库mydb2。</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">2.退出MySQL 可以输入命令exit;或者quit;</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">3.在CMD中输入下列命令：</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "></p><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "><ol class="dp-xml" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "><li class="alt" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; ">c:\</span><span class="tag" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 7px; padding-right: 0px; padding-bottom: 4px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; width: 635px; line-height: 18px; font-weight: bold; ">&gt;</span></span>MySQL&nbsp;-h&nbsp;localhost&nbsp;-u&nbsp;root&nbsp;-p&nbsp;mydb2&nbsp;&lt;&nbsp;<span class="tag-name" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: #006699; background-color: inherit; font-weight: bold; ">e:</span>\MySQL\mydb2.sql&nbsp;</li></ol></pre><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">然后输入密码，就OK了。</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "><strong style="font-weight: bold; text-align: center; ">五.下面谈一下关于导入文件大小限制问题的解决：</strong></p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">默认情况下：MySQL导入文件大小有限制的，最大为2M，所以当文件很大时候，直接无法导入，下面就这个问题的解决列举如下：</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">1.在php.ini中修改相关参数：</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">影响MySQL导入文件大小的参数有三个：</p><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; "></p><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 1em; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; font-family: 'Courier New', monospace; font-size: 12px; width: 591px; overflow-x: auto; overflow-y: auto; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #e6e6e6; background-position: initial initial; background-repeat: initial initial; "><ol class="dp-xml" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 55px; padding-top: 5px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; color: #5c5c5c; list-style-type: decimal; list-style-position: initial; list-style-image: initial; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f7f7f7; background-position: initial initial; background-repeat: initial initial; "><li class="alt" style="margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 3px !important; padding-bottom: 0px !important; padding-left: 10px !important; list-style-type: decimal; list-style-position: outside !important; list-style-image: none; word-wrap: break-word; word-break: normal; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; background-image: url(http://images.51cto.com/images/art1105/images/0.gif); background-attachment: scroll; background-origin: initial; background-clip: initial; background-color: transparent; line-height: 18px; background-position: -498px -70px; background-repeat: no-repeat repeat; "><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; "><span class="attribute" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: red; background-color: inherit; ">memory_limit</span><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; ">=</span><span class="attribute-value" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; ">128M</span><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; ">,</span><span class="attribute" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: red; background-color: inherit; ">upload_max_filesize</span><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; ">=</span><span class="attribute-value" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; ">2M</span><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; ">,</span><span class="attribute" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: red; background-color: inherit; ">post_max_size</span><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; ">=</span><span class="attribute-value" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: blue; background-color: inherit; ">8M</span><span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; color: black; background-color: inherit; ">&nbsp;</span></span></li></ol></pre><p style="margin-top: 10px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; background-color: transparent; text-indent: 28px; ">修改upload_ ......</p></span><span class="Apple-style-span" style="color: #333333; font-family: tahoma, arial, 宋体, sans-serif; background-color: #ffffff; "><pre style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-family: 'courier new', courier, monospace; ">参考文章：</pre></span><span class="Apple-style-span" style="color: #333333; font-family: tahoma, arial, 宋体, sans-serif; background-color: #ffffff; "><div><a href="http://database.51cto.com/art/201005/200739.htm">http://database.51cto.com/art/201005/200739.htm</a></div></span><img src ="http://www.blogjava.net/GavinMiao/aggbug/364499.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/GavinMiao/" target="_blank">GavinMiao</a> 2011-11-22 10:54 <a href="http://www.blogjava.net/GavinMiao/archive/2011/11/22/364499.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>sql面试题</title><link>http://www.blogjava.net/GavinMiao/archive/2011/10/20/361642.html</link><dc:creator>GavinMiao</dc:creator><author>GavinMiao</author><pubDate>Thu, 20 Oct 2011 03:34:00 GMT</pubDate><guid>http://www.blogjava.net/GavinMiao/archive/2011/10/20/361642.html</guid><wfw:comment>http://www.blogjava.net/GavinMiao/comments/361642.html</wfw:comment><comments>http://www.blogjava.net/GavinMiao/archive/2011/10/20/361642.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/GavinMiao/comments/commentRss/361642.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/GavinMiao/services/trackbacks/361642.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;只有注册用户登录后才能阅读该文。<a href='http://www.blogjava.net/GavinMiao/archive/2011/10/20/361642.html'>阅读全文</a><img src ="http://www.blogjava.net/GavinMiao/aggbug/361642.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/GavinMiao/" target="_blank">GavinMiao</a> 2011-10-20 11:34 <a href="http://www.blogjava.net/GavinMiao/archive/2011/10/20/361642.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>转载：mysql表连接总结</title><link>http://www.blogjava.net/GavinMiao/archive/2011/10/20/361640.html</link><dc:creator>GavinMiao</dc:creator><author>GavinMiao</author><pubDate>Thu, 20 Oct 2011 03:24:00 GMT</pubDate><guid>http://www.blogjava.net/GavinMiao/archive/2011/10/20/361640.html</guid><wfw:comment>http://www.blogjava.net/GavinMiao/comments/361640.html</wfw:comment><comments>http://www.blogjava.net/GavinMiao/archive/2011/10/20/361640.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/GavinMiao/comments/commentRss/361640.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/GavinMiao/services/trackbacks/361640.html</trackback:ping><description><![CDATA[<div><div>文章来源：<a href="http://blog.sina.com.cn/s/blog_3d48dbb70100hyz4.html">http://blog.sina.com.cn/s/blog_3d48dbb70100hyz4.html</a><br />作者：涛涛</div><div></div><div>首先my sql 不支持oracle的(+)&nbsp;</div><div></div><div>内连接: 只连接匹配的行</div><div>左外连接: 包含左边表的全部行（不管右边的表中是否存在与它们匹配的行），以及右边表中全部匹配的行</div><div>右外连接: 包含右边表的全部行（不管左边的表中是否存在与它们匹配的行），以及左边表中全部匹配的行</div><div>全外连接: 包含左、右两个表的全部行，不管另外一边的表中是否存在与它们匹配的行。</div><div>交叉连接 &nbsp;生成笛卡尔积－它不使用任何匹配或者选取条件，而是直接将一个数据源中的每个行与另一个数据源的每个</div><div></div><div>行都一一匹配</div><div></div><div>举个例子吧。</div><div>表A</div><div>id &nbsp; name&nbsp;</div><div>1 &nbsp; &nbsp;张</div><div>2 &nbsp; &nbsp;李</div><div>3 &nbsp; &nbsp;王</div><div></div><div>表B</div><div>id &nbsp; address &nbsp; A_id</div><div>1 &nbsp; &nbsp;北京 &nbsp; &nbsp; &nbsp;1</div><div>2 &nbsp; &nbsp;上海 &nbsp; &nbsp; &nbsp;3</div><div>3 &nbsp; &nbsp;南京 &nbsp; &nbsp; &nbsp;10</div><div></div><div>包容性:A表包容B表,左连接左表是全的.(left join 或 left outer join )</div><div>SQL语句如下：</div><div>SELECT A.name, B.address</div><div>FROM A</div><div>LEFT JOIN B ON A.id = B.A_id</div><div>查询结果为：</div><div>name &nbsp; &nbsp; address</div><div>张 &nbsp; &nbsp; 北京</div><div>李 &nbsp; &nbsp; NULL</div><div>王 &nbsp; &nbsp; 上海</div><div></div><div>包容性:B表包容A表,右连接右表是全的.(right join 或 right outer join )</div><div>SQL语句如下：</div><div>SELECT A.name, B.address</div><div>FROM A</div><div>RIGHT JOIN B ON A.id = B.A_id</div><div>查询结果为：</div><div>name &nbsp; &nbsp; address</div><div>张 &nbsp; &nbsp; 北京</div><div>王 &nbsp; &nbsp; 上海</div><div>NULL &nbsp; &nbsp; 南京</div><div></div><div>排他性:A,B表中至少有1个匹配时，才返回行。两表的交集</div><div>SQL语句如下：</div><div>select A.name,B.address from A</div><div>inner join B</div><div>on A.id = B.A_id</div><div></div><div>查询结果为：</div><div>name &nbsp; &nbsp; address</div><div>张 &nbsp; &nbsp; 北京</div><div>王 &nbsp; &nbsp; 上海</div><div>inner join &nbsp;内连接等价于下面的sql:</div><div>SELECT A.name, B.address</div><div>FROM A, B</div><div>WHERE A.id = B.A_id</div><div></div><div>注释:全外连接返回参与连接的两个数据集合中的全部数据，无论它们是否具有与之相匹配的行。在功能上，它等价于</div><div></div><div>对这两个数据集合分别进行左外连接和右外连接，然后再使用消去重复行的并操作将上述两个结果集合并为一个结果集</div><div></div><div>。(full join 或 full outer join )</div><div>SQL语句如下：</div><div>select * from A</div><div>full join B</div><div>查询结果为：</div><div>id &nbsp; &nbsp; name &nbsp; &nbsp; id &nbsp; &nbsp; address A_id</div><div>1 &nbsp; &nbsp; 张 &nbsp; &nbsp; 1 &nbsp; &nbsp; 北京 &nbsp; &nbsp; 1</div><div>2 &nbsp; &nbsp; 李 &nbsp; &nbsp; 1 &nbsp; &nbsp; 北京 &nbsp; &nbsp; 1</div><div>3 &nbsp; &nbsp; 王 &nbsp; &nbsp; 1 &nbsp; &nbsp; 北京 &nbsp; &nbsp; 1</div><div>1 &nbsp; &nbsp; 张 &nbsp; &nbsp; 2 &nbsp; &nbsp; 上海 &nbsp; &nbsp; 3</div><div>2 &nbsp; &nbsp; 李 &nbsp; &nbsp; 2 &nbsp; &nbsp; 上海 &nbsp; &nbsp; 3</div><div>3 &nbsp; &nbsp; 王 &nbsp; &nbsp; 2 &nbsp; &nbsp; 上海 &nbsp; &nbsp; 3</div><div>1 &nbsp; &nbsp; 张 &nbsp; &nbsp; 3 &nbsp; &nbsp; 南京 &nbsp; &nbsp; 10</div><div>2 &nbsp; &nbsp; 李 &nbsp; &nbsp; 3 &nbsp; &nbsp; 南京 &nbsp; &nbsp; 10</div><div>3 &nbsp; &nbsp; 王 &nbsp; &nbsp; 3 &nbsp; &nbsp; 南京 &nbsp; &nbsp; 10</div><div></div><div>注释：返回3*3=9条记录，即笛卡尔积</div><div>SQL语句如下：</div><div>SELECT * FROM A</div><div>CROSS JOIN B</div><div>查询结果为：</div><div>id &nbsp; &nbsp; name &nbsp; &nbsp; id &nbsp; &nbsp; address A_id</div><div>1 &nbsp; &nbsp; 张 &nbsp; &nbsp; 1 &nbsp; &nbsp; 北京 &nbsp; &nbsp; 1</div><div>2 &nbsp; &nbsp; 李 &nbsp; &nbsp; 1 &nbsp; &nbsp; 北京 &nbsp; &nbsp; 1</div><div>3 &nbsp; &nbsp; 王 &nbsp; &nbsp; 1 &nbsp; &nbsp; 北京 &nbsp; &nbsp; 1</div><div>1 &nbsp; &nbsp; 张 &nbsp; &nbsp; 2 &nbsp; &nbsp; 上海 &nbsp; &nbsp; 3</div><div>2 &nbsp; &nbsp; 李 &nbsp; &nbsp; 2 &nbsp; &nbsp; 上海 &nbsp; &nbsp; 3</div><div>3 &nbsp; &nbsp; 王 &nbsp; &nbsp; 2 &nbsp; &nbsp; 上海 &nbsp; &nbsp; 3</div><div>1 &nbsp; &nbsp; 张 &nbsp; &nbsp; 3 &nbsp; &nbsp; 南京 &nbsp; &nbsp; 10</div><div>2 &nbsp; &nbsp; 李 &nbsp; &nbsp; 3 &nbsp; &nbsp; 南京 &nbsp; &nbsp; 10</div><div>3 &nbsp; &nbsp; 王 &nbsp; &nbsp; 3 &nbsp; &nbsp; 南京 &nbsp; &nbsp; 10</div><div>CROSS JOIN等价于:</div><div>select * from A,B</div><div></div><div>注意:</div><div>1. on A.id = B.id 等同于 using(id)//这里字段名要相同</div><div>2. 当 MySQL 在从一个表中检索信息时，你可以提示它选择了哪一个索引。 &nbsp;</div><div>如果 EXPLAIN 显示 MySQL 使用了可能的索引列表中错误的索引，这个特性将是很有用的。 &nbsp;</div><div>通过指定 USE INDEX (key_list)，你可以告诉 MySQL 使用可能的索引中最合适的一个索引在表中查找记录行。 &nbsp;</div><div>可选的二选一句法 IGNORE INDEX (key_list) 可被用于告诉 MySQL 不使用特定的索引。 &nbsp; &nbsp;</div><div></div><div>效率问题:</div><div>1.inner join比left join快</div><div>注:inner join &nbsp;内连接等价于下面的sql: SELECT A.name, B.address FROM A, B WHERE A.id = B.A_id</div><div>所以一般要用一般的连接就可以了.</div><div>2.连接字段建索引</div><div></div><div></div><div></div><div></div><div>多表外连接</div><div>select &nbsp; A.*,B.f1,B.f2,B.fn,C.f1,C.f2,C.fn &nbsp; from &nbsp; A &nbsp; &nbsp;</div><div>&nbsp; left &nbsp; join &nbsp; B &nbsp; on &nbsp; A.id=B.id &nbsp; &nbsp;</div><div>&nbsp; left &nbsp; join &nbsp; C &nbsp; on &nbsp; C.id=A.id &nbsp;</div><div>&nbsp; where .......<br /><br /></div></div><img src ="http://www.blogjava.net/GavinMiao/aggbug/361640.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/GavinMiao/" target="_blank">GavinMiao</a> 2011-10-20 11:24 <a href="http://www.blogjava.net/GavinMiao/archive/2011/10/20/361640.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>异常总结：MySQL+Hibernate下连接空闲8小时自动断开问题解决方案</title><link>http://www.blogjava.net/GavinMiao/archive/2011/09/06/358075.html</link><dc:creator>GavinMiao</dc:creator><author>GavinMiao</author><pubDate>Tue, 06 Sep 2011 04:04:00 GMT</pubDate><guid>http://www.blogjava.net/GavinMiao/archive/2011/09/06/358075.html</guid><wfw:comment>http://www.blogjava.net/GavinMiao/comments/358075.html</wfw:comment><comments>http://www.blogjava.net/GavinMiao/archive/2011/09/06/358075.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/GavinMiao/comments/commentRss/358075.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/GavinMiao/services/trackbacks/358075.html</trackback:ping><description><![CDATA[<div><span class="Apple-style-span" style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff; "><p>mysql﹥ show global variables like 'wait_timeout';</p><p>+---------------+---------+</p><p>| Variable_name | Value |</p><p>+---------------+---------+</p><p>| wait_timeout | 28800 |</p><p>+---------------+---------+&nbsp;<br /></p></span><span class="Apple-style-span" style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff; "><p>我们只要修改mysql5的配置文件&#8220;my.ini&#8221;(mysql5 installation dir)，增加一行：</p></span><span class="Apple-style-span" style="font-family: 宋体; line-height: 26px; background-color: #ffffff; font-size: medium; ">wait_timeout=31536000</span><span class="Apple-style-span" style="line-height: 26px; background-color: #ffffff; "><p class="MsoNormal" style="color: #333333; font-family: Arial; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span lang="EN-US" style="color: black; font-family: 宋体; "><span style="font-size: small; "><span style="font-size: medium; ">interactive_timeout=31536000</span></span></span></p><p class="MsoNormal" style="color: #333333; font-family: Arial; margin-top: 0cm; margin-right: 0cm; margin-bottom: 0pt; margin-left: 0cm; "><span style="color: black; font-family: 宋体; "><span style="font-size: small; "><span style="font-size: medium; ">重启生效，需要同时修改这两个参数。</span></span></span></p></span><span class="Apple-style-span" style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff; "><p><br /></p></span><span class="Apple-style-span" style="color: #333333; font-family: Arial; line-height: 26px; background-color: #ffffff; "><p><br /></p></span></div><img src ="http://www.blogjava.net/GavinMiao/aggbug/358075.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/GavinMiao/" target="_blank">GavinMiao</a> 2011-09-06 12:04 <a href="http://www.blogjava.net/GavinMiao/archive/2011/09/06/358075.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>mysql错误积累：Data too long for column问题</title><link>http://www.blogjava.net/GavinMiao/archive/2011/09/05/358013.html</link><dc:creator>GavinMiao</dc:creator><author>GavinMiao</author><pubDate>Mon, 05 Sep 2011 10:08:00 GMT</pubDate><guid>http://www.blogjava.net/GavinMiao/archive/2011/09/05/358013.html</guid><wfw:comment>http://www.blogjava.net/GavinMiao/comments/358013.html</wfw:comment><comments>http://www.blogjava.net/GavinMiao/archive/2011/09/05/358013.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/GavinMiao/comments/commentRss/358013.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/GavinMiao/services/trackbacks/358013.html</trackback:ping><description><![CDATA[<div><span class="Apple-style-span" style="font-family: Helvetica, Tahoma, Arial, sans-serif; line-height: 25px; background-color: #ffffff; ">导入数据的时候，MYSQL 报错:Data too long for column&nbsp;<br /><br />解决办法:&nbsp;<br /><br />在my.ini里找到(此文件在mysql安装目录下)&nbsp;<br />sql-mode=&#8221;STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&#8221;&nbsp;<br />把其中的STRICT_TRANS_TABLES,去掉,&nbsp;<br />或者把sql-mode=STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION&nbsp;<br /><br />注释掉，然后重启mysql就ok了&nbsp;！</span></div><img src ="http://www.blogjava.net/GavinMiao/aggbug/358013.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/GavinMiao/" target="_blank">GavinMiao</a> 2011-09-05 18:08 <a href="http://www.blogjava.net/GavinMiao/archive/2011/09/05/358013.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>mysql日期、时间格式</title><link>http://www.blogjava.net/GavinMiao/archive/2011/09/03/357876.html</link><dc:creator>GavinMiao</dc:creator><author>GavinMiao</author><pubDate>Sat, 03 Sep 2011 04:35:00 GMT</pubDate><guid>http://www.blogjava.net/GavinMiao/archive/2011/09/03/357876.html</guid><wfw:comment>http://www.blogjava.net/GavinMiao/comments/357876.html</wfw:comment><comments>http://www.blogjava.net/GavinMiao/archive/2011/09/03/357876.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/GavinMiao/comments/commentRss/357876.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/GavinMiao/services/trackbacks/357876.html</trackback:ping><description><![CDATA[<div>select current_date;<br /><div><div>create table test(&#8216;日期&#8217; date);</div></div><div>insert into test values('2011-09-03');<br /><div>create table test2(日期 date,时间 datetime);<br /><div>create table test(日期 date,时间 timestamp);<br /><div>insert into test2 values('2011-09-03','2011-09-03 02:00:00');<br /><div>insert into test values('2011-09-03','2011-09-03 02:00:00');</div></div></div></div><span class="Apple-style-span" style="color: #4b4b4b; font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 19px; background-color: #ffffff; "><p style="line-height: 19px; "><a href="http://qsrock.javaeye.com/blog/143733" target="_blank" style="color: #1a8bc8; text-decoration: none; ">mysql插入当前时间</a></p><fieldset><legend></legend>now()函数以`yyyy-mm-dd hh:mm:ss返回当前的日期时间，可以直接存到datetime字段中。&nbsp;<br />curdate()以&#8217;yyyy-mm-dd&#8217;的格式返回今天的日期，可以直接存到date字段中。&nbsp;<br />curtime()以&#8217;hh:mm:ss&#8217;的格式返回当前的时间，可以直接存到time字段中。</fieldset><p style="line-height: 19px; ">&nbsp;</p></span></div></div><img src ="http://www.blogjava.net/GavinMiao/aggbug/357876.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/GavinMiao/" target="_blank">GavinMiao</a> 2011-09-03 12:35 <a href="http://www.blogjava.net/GavinMiao/archive/2011/09/03/357876.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>