⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 manual_introduction.html

📁 关于mysql学习的 中文教程
💻 HTML
📖 第 1 页 / 共 3 页
字号:
  <li>没有内存漏洞。用一个商用内存漏洞监测程序测试过(<code>purify</code>)。</li>
  <li>包括<code>myisamchk</code>,一个检查、优化和修复数据库表的快速实用程序,详见<a
    HREF="manual_Maintenance.html#Maintenance">13 维护&nbsp;MySQL安装</a>。 </li>
  <li>全面支持ISO-8859-1&nbsp;&nbsp;Latin1&nbsp;字符集。例如,斯堪的纳维亚的字符 
    @ringaccent{a}, @&quot;a and @&quot;o&nbsp;在表和列名字被允许。</li>
  <li>所有数据以&nbsp;ISO-8859-1&nbsp;&nbsp;Latin1&nbsp;格式保存。所有正常的字符串比较是忽略大小写的。</li>
  <li>根据&nbsp;ISO-8859-1&nbsp;&nbsp;Latin1&nbsp;字符集进行排序(目前瑞典语的方式)。通过在源代码中增加排序顺序数组可以改变它。为了理解一个更高级的排序例子,看一看捷克语的排序代码。<strong>MySQL</strong>支持可在编译时指定的很多不同的字符集。</li>
  <li>表和列的别名符合&nbsp;SQL92&nbsp;标准。</li>
  <li><code>DELETE</code>、<code>INSERT</code>、<code>REPLACE</code>和<code>UPDATE </code>返回有多少行被改变(受影响)。</li>
  <li>函数名不会与表或列名冲突。例如<code>ABS</code>是一个有效的列名字。对函数调用的唯一限制是函数名与随后的<samp>“(”</samp>不能有空格。详见<a
    HREF="manual_Reference.html#Reserved_words">7.31 MySQL对保留字很挑剔吗?</a>。 </li>
  <li>所有<strong>MySQL</strong>程序可以用选项<code>--help</code>或<code>-?</code>获得联机帮助。</li>
  <li>服务器能为客户提供多种语言的出错消息,详见<a
    HREF="manual_Server.html#Languages">9.1 MySQL支持哪些语言?</a>。 </li>
  <li>客户端使用TCP/IP&nbsp;连接或Unix套接字(socket)或NT下的命名管道连接<strong>MySQL</strong>。</li>
  <li><strong>MySQL</strong>特有的<code>SHOW</code>命令可用来检索数据库、表和索引的信息<code>,EXPLAIN</code>命令可用来确定优化器如何解决一个查询。</li>
</ul>

<p> </p>

<h2><a NAME="Stability" HREF="manual_toc.html#Stability">1.5 MySQL的稳定性?</a></h2>

<p>本小节回答这样的问题:“<strong>MySQL</strong>的稳定程度?”和 
“我能在本项目中依赖<strong>MySQL</strong>吗?”。这里我们将试图澄清一些问题并且回答似乎很多人关心的更重要的问题。本节已经与从邮件列表(它在报导错误是很活跃的)收集了的信息综合在一起。</p>

<p>对TcX,<strong>MySQL</strong>在我们自1996中期开始的计划中运行没有发生任何问题。当<strong>MySQL</strong>被更公开地发布时,我们注意到了有一些&nbsp;“未测试代码”片断很快地被不同于我们的查询方式的新用户发现。每个新版本比前一个都有更少的可移植性问题(尽管每个发行有许多新功能),并且我们希望有可能把下一个版本之一标记为“稳定”的。</p>

<p>每个<strong>MySQL</strong>的发行都是可用的,并且只有当用户使用从“灰色地带”来的代码时才有问题,当然,不知情的用户不能知道灰色地带是什么;本小节尝试揭示我们目前已知的东西。这里的描述涉及<strong>MySQL</strong> 
3.&nbsp;22.x&nbsp;版本。所有已知和报告的错误都会在最新的版本被更正,除了在错误小节中列出的与“设计n”有关的错误。详见<a
HREF="manual_Bugs.html#Bugs">E MySQL已知的错误和设计缺陷</a>。</p>

<p><strong>MySQL</strong>以多层结构和不同的独立模块编写,这些模块列举在下面以表明它们中的每一个是如何很好地被测试过: 

<dl COMPACT>
  <dt><strong>ISAM表处理器--稳定</strong></dt>
  <dd>它管理所有在<strong>MySQL</strong> 3.22和早期版本中的数据的存储和检索。在所有<strong>MySQL</strong>版本中,代码中已经没有一个单独(报告的)错误。得到一个损坏的数据库表的唯一已知方法是在一个更新中途杀死服务器,即使这样也不大可能破坏任何数据而不能挽救,因为所有数据在每个查询之间被倒入(flush)到磁盘,而且从来没有一个有关由于<strong>MySQL</strong>中的错误而丢失数据的错误报告。</dd>
  <dt><strong>MyISAM&nbsp;表处理器--&nbsp;Beta&nbsp;</strong></dt>
  <dd>这是<strong>&nbsp;MySQL&nbsp;</strong>3.23的新功能,它大部分是基于ISAM表代码但有很多新的有用的功能。</dd>
  <dt><strong>语法处理器和词法分析器&nbsp;--稳定</strong></dt>
  <dd>很长时间没有一个在这个系统中的错误报告。</dd>
  <dt><strong>C&nbsp;客户代码--稳定</strong></dt>
  <dd>没有已知的问题。在早期的&nbsp;3.&nbsp;20版本中,在发送/接收缓冲器的大小上有一些限制。&nbsp;3.21.x后,现在缓冲器的大小是动态的,可到一个24M的缺省值。</dd>
  <dt><strong>标准客户程序--稳定</strong></dt>
  <dd>这些包括<code>mysql</code>、<code>mysqladmin</code>和<code>mysqlshow</code>、<code>mysqldump</code>及<code>mysqlimport</code>。 
  </dd>
  <dt><strong>基本结构式查询语言--稳定</strong></dt>
  <dd>基本SQL函数系统、字符串类和动态内存处理,本系统中未见单独报告的错误。</dd>
  <dt><strong>查询优化程序--稳定</strong></dt>
  <dd> </dd>
  <dt><strong>范围优化程序--&nbsp;Gamma&nbsp;</strong></dt>
  <dd> </dd>
  <dt><strong>Join优化器--稳定</strong></dt>
  <dd> </dd>
  <dt><strong>锁定--&nbsp;Gamma&nbsp;</strong></dt>
  <dd>这是非常依赖于系统的,在某些系统上,用标准操作系统锁定(<code>fcntl()</code>)有很大问题,在这些情况下,你应该用选项<code>--skip-locking</code>运行<strong>MySQL</strong>守护程序。当使用NFS挂载的文件系统,已知在一些&nbsp;Linux&nbsp;系统上和SunOS上出现问题。</dd>
  <dt><strong>Linux&nbsp;线程--&nbsp;Gamma&nbsp;</strong></dt>
  <dd>唯一发现的问题式<code>fcntl()</code>调用,它通过使用<code>mysqld</code>的<code>--skip-locking</code>选项解决。一些人已经报告了0.5版中的锁定问题。</dd>
  <dt><strong>Solaris&nbsp;2.5&nbsp;+&nbsp;pthreads&nbsp;--稳定</strong></dt>
  <dd>我们在我们的开发工作中使用。</dd>
  <dt><strong>MIT-pthreads&nbsp;(其他系统)--&nbsp;Gamma&nbsp;</strong></dt>
  <dd>自从&nbsp;3.20.15版以来,没有报告的错误,而且从3.20.16开始没有已知的错误。在一些系统上,在一些操作是相当慢时(在每查询之间有&nbsp;1/20秒的睡眠&nbsp;)有一个“功能失效”。当然,MIT-pthreads&nbsp;可能使任何事情慢一点,但是基于索引<code>的SELECT</code>语句通常在一个时帧内完成,因此不应该有一个mutex&nbsp;锁定/线程的把戏。</dd>
  <dt><strong>其他线程实现&nbsp;--&nbsp;Alpha&nbsp;-&nbsp;Beta&nbsp;</strong></dt>
  <dd>移植到其他系统仍然是很新的并且可能有错误,可能是在<strong>MySQL</strong>中,但是最通常的是线程实现本身。</dd>
  <dt><strong><code>LOAD DATA ... </code>,<code>INSERT ... SELECT </code>--稳定</strong></dt>
  <dd>一些人已经认为他们在这里发现了错误,但是这些经常多是误解。请在报告问题前检查手册!</dd>
  <dt><strong><code>ALTER TABLE </code>--稳定</strong></dt>
  <dd>在&nbsp;3.22.12中有小的改变。</dd>
  <dt><strong>DBD&nbsp;--稳定</strong></dt>
  <dd>现在由&nbsp;Jochen&nbsp;&nbsp;Wiedmann&nbsp;维护了。</dd>
  <dt><strong><code>mysqlaccess</code> --稳定</strong></dt>
  <dd>由&nbsp;Yves&nbsp;&nbsp;Carlier&nbsp;编写并维护。</dd>
  <dt><strong><code>GRANT </code>--&nbsp;Gamma&nbsp;</strong></dt>
  <dd><strong>MySQL&nbsp;</strong>3.22.12.做了很大改变。</dd>
  <dt><strong><strong>MyODBC </strong>(使用&nbsp;ODBC&nbsp;&nbsp;SDK&nbsp;2.5&nbsp;)--&nbsp;Gamma&nbsp;</strong></dt>
  <dd>它与一些程序似乎工作得很好。</dd>
</dl>

<p>TcX&nbsp;为付费客户提供电子邮件的支持,但是<strong>MySQL</strong>邮件列表通常提供常见问题的答案,错误通常马上用一个补丁修补,对严重的错误,几乎总是有新的版本发行。</p>

<p><a NAME="IDX7"></a></p>

<h2><a NAME="Year_2000_compliance" HREF="manual_toc.html#Year_2000_compliance">1.6 顺应2000年(Year 
2000 compliance)</a></h2>

<p><strong>MySQL</strong>本身己没有2000年有问题(&nbsp;Y2K&nbsp;): 

<ul>
  <li><strong>MySQL</strong>使用Unix时间函数并且在<code>2069</code>年前没有日期问题, 
    所有2位年份被认为在<code>1970</code>年到<code>2069</code>年的范围,这意味着如果在一个<code>year</code>类型的列中存储的01,<strong>MySQL</strong>把它当作<code>2001</code>。 
  </li>
  <li>所有<strong>MySQL</strong>日期函数存储在一个文件<tt>'sql/time.cc'中</tt>,并且很仔细地编码保证是2000年安全的&nbsp;。</li>
  <li><strong>MySQL</strong>&nbsp;3.22&nbsp;和以后的版本,新的<code>YEAR</code>类型的列能在一个字节中存储0年和<code>1901年</code>到<code>2155年</code>,并用使用2或4位显示它们。</li>
</ul>

<p>你可以用一种不是Y2K-safe的方式使用<strong>&nbsp;MySQL</strong>应用程序来深入该问题。例如,许多老的应用程序使用2位数字(它有二义性)而非4位数字存储或操作年份,这个问题可能与使用诸如<code>00</code>或<code>99</code>作为“丢失的”值的提示的应用程序混淆起来。</p>

<p>很不幸,这些问题可能很难修复,因为不同的应用程序可能由不同程序员编写,其中每一个可能使用了不同的约定和日期处理函数。</p>

<p>这里是简单的示范,显示<strong>MySQL</strong>在&nbsp;2030&nbsp;年之前没有任何日期问题。</p>

<pre>mysql&gt; DROP TABLE IF EXISTS y2k;
mysql&gt; CREATE TABLE y2k (date date, date_time datetime, time_stamp timestamp);
mysql&gt; INSERT INTO y2k VALUES (&quot;1998-12-31&quot;,&quot;1998-12-31 23:59:59&quot;,19981231235959);
mysql&gt; INSERT INTO y2k VALUES (&quot;1999-01-01&quot;,&quot;1999-01-01 00:00:00&quot;,19990101000000);
mysql&gt; INSERT INTO y2k VALUES (&quot;1999-09-09&quot;,&quot;1999-09-09 23:59:59&quot;,19990909235959);
mysql&gt; INSERT INTO y2k VALUES (&quot;2000-01-01&quot;,&quot;2000-01-01 00:00:00&quot;,20000101000000);
mysql&gt; INSERT INTO y2k VALUES (&quot;2000-02-28&quot;,&quot;2000-02-28 00:00:00&quot;,20000228000000);
mysql&gt; INSERT INTO y2k VALUES (&quot;2000-02-29&quot;,&quot;2000-02-29 00:00:00&quot;,20000229000000);
mysql&gt; INSERT INTO y2k VALUES (&quot;2000-03-01&quot;,&quot;2000-03-01 00:00:00&quot;,20000301000000);
mysql&gt; INSERT INTO y2k VALUES (&quot;2000-12-31&quot;,&quot;2000-12-31 23:59:59&quot;,20001231235959);
mysql&gt; INSERT INTO y2k VALUES (&quot;2001-01-01&quot;,&quot;2001-01-01 00:00:00&quot;,20010101000000);
mysql&gt; INSERT INTO y2k VALUES (&quot;2004-12-31&quot;,&quot;2004-12-31 23:59:59&quot;,20041231235959);
mysql&gt; INSERT INTO y2k VALUES (&quot;2005-01-01&quot;,&quot;2005-01-01 00:00:00&quot;,20050101000000);
mysql&gt; INSERT INTO y2k VALUES (&quot;2030-01-01&quot;,&quot;2030-01-01 00:00:00&quot;,20300101000000);
mysql&gt; INSERT INTO y2k VALUES (&quot;2050-01-01&quot;,&quot;2050-01-01 00:00:00&quot;,20500101000000);
mysql&gt; SELECT * FROM y2k;
+------------+---------------------+----------------+
| date       | date_time           | time_stamp     |
+------------+---------------------+----------------+
| 1998-12-31 | 1998-12-31 23:59:59 | 19981231235959 |
| 1999-01-01 | 1999-01-01 00:00:00 | 19990101000000 |
| 1999-09-09 | 1999-09-09 23:59:59 | 19990909235959 |
| 2000-01-01 | 2000-01-01 00:00:00 | 20000101000000 |
| 2000-02-28 | 2000-02-28 00:00:00 | 20000228000000 |
| 2000-02-29 | 2000-02-29 00:00:00 | 20000229000000 |
| 2000-03-01 | 2000-03-01 00:00:00 | 20000301000000 |
| 2000-12-31 | 2000-12-31 23:59:59 | 20001231235959 |
| 2001-01-01 | 2001-01-01 00:00:00 | 20010101000000 |
| 2004-12-31 | 2004-12-31 23:59:59 | 20041231235959 |
| 2005-01-01 | 2005-01-01 00:00:00 | 20050101000000 |
| 2030-01-01 | 2030-01-01 00:00:00 | 20300101000000 |
| 2050-01-01 | 2050-01-01 00:00:00 | 00000000000000 |
+------------+---------------------+----------------+

13 rows in set (0.00 sec)
</pre>

<p>这表示<code>DATE</code>和<code>DATETIME</code>类型将不会有未来日期的任何问题(它们处理日期到&nbsp;9999&nbsp;)。</p>

<p><code>TIMESTAMP</code>类型被用来存储当前时间,有一个仅<code>2030-01-01</code>的上限。<code>TIMESTAMP</code>在32位的机器上(有符号值)有一个从<code>1970</code>到<code>2030</code>的范围,在64位机器上它处理时间可达<code>2106</code>(无符号值)。</p>

<p>尽管<strong>MySQL</strong>是顺应Y2K的,但提供无二义性的输入是你的责任。对于<strong>MySQL</strong>处理二义性日期的输入(包含2位数字年份)的规则,详见<a
HREF="manual_Reference.html#Y2K_issues">7.3.6.1 Y2K&nbsp;问题和日期类型</a>。</p>
<a NAME="General-SQL" HREF="manual_toc.html#General-SQL">

<h2>1.7 SQL一般信息和教程</a></h2>

<p>在<strong>MySQL</strong>邮件列表上,这本书被多人推荐:</p>

<pre>Judith S. Bowman, Sandra L. Emerson and Marcy Darnovsky
The Practical SQL Handbook: Using Structured Query Language
Second Edition
Addison-Wesley
ISBN 0-201-62623-3
http://www.awl.com</pre>

<p>这本书也接受了&nbsp;MySQL&nbsp;用户的一些建议:</p>

<pre>Martin Gruber
Understanding SQL
ISBN 0-89588-644-8
Publisher Sybex 510 523 8233
Alameda, CA USA
</pre>

<p>一本SQL语言教程可在&nbsp;http://www.geocities.com/SiliconValley/Vista/2207/sql1.html&nbsp;找到。</p>

<p>SQL in 21 Tagen (用德语写的网上书籍) &nbsp;http://www.mut.de/leseecke/buecher/sql/inhalt.htm&nbsp;。</p>
<a NAME="Useful_Links" HREF="manual_toc.html#Useful_Links">

<h2>1.8&nbsp;有用的MySQL相关链接</a> </h2>

<h3>1.8.1 教程</h3>

<ul>
  <li><a href="http://www.devshed.com/resource/advanced/mysql/index.html">A beginner's tutoral 
    of how to start using <strong>&nbsp;MySQL&nbsp;</strong></a></li>
  <li><a href="http://www.analysisandsolutions.com/code/mybasic.htm">http://www.analysisandsolutions.com/code/mybasic.htm 
    </a>新手如何在一台Windows&nbsp;机器上安装和设置<strong>MySQL</strong>。</li>
  <li><a href="http://www.devshed.com/Server_Side/MySQL/default.htm">很多<strong>MySQL</strong>教程</a></li>
  <li><a href="http://www.linuxplanet.com/linuxplanet/tutorials/1046/1/default.htm">建立一个基于&nbsp;MySQL的网站</a></li>
  <li><a href="http://www.hotwired.com/webmonkey/backend/tutorials/tutorial1.html"><strong>MySQL</strong>-&nbsp;perl&nbsp;教程</a></li>
  <li><a href="http://www.hotwired.com/webmonkey/databases/tutorials/tutorial4.html">PHP/MySQL&nbsp;教程</a></li>
</ul>

<h3>1.8.2 Perl相关链接</h3>

<ul>
  <li><a href="http://haven.e-cactus.com/dbi_mysql">MySQL&nbsp;的Perl&nbsp;&nbsp;DBI FAQ&nbsp;</a></li>
</ul>

<h3>1.8.3 MySQL&nbsp;讨论论坛</h3>

<ul>
  <li><a href="http://webdev.weberdev.com/default.htm">使用<strong>MySQL</strong>实例 
    (check Top 20)</a></li>
</ul>

<h3>1.8.4 支持&nbsp;MySQL&nbsp;的商业应用</h3>

<ul>
  <li><a href="http://www.supportwizard.com/default.htm">SupportWizard; Interactive helpdesk 
    on the web (This product includes a licensed copy of MySQL)</a></li>
  <li><a href="http://www.rightnowtech.com/default.htm">Right Now Web; Web automation for 
    customer service</a></li>
  <li><a href="http://www.icaap.org/Bazaar/default.htm">Bazaar; Interactive Discussion Forums 
    with web interface</a></li>
  <li><a href="http://www.phonesweep.com/default.htm">PhoneSweepT&nbsp;</a> 
    是世界的第一个商业电话扫描仪.近年来的很多侵入不是通过因特网,而是通过非法的拨号调制解调器.&nbsp;PhoneSweep&nbsp;让你通过循环地将电话发到你的公司控制的每个号码上来发现这些调制解调器,&nbsp;PhoneSweep有一个内置的专家系统,能识别出超过&nbsp;250&nbsp;种不同类型的遥远存取程序,包括Carbon 
    &nbsp;CopyT&nbsp;、pcANYWHERET&nbsp;和&nbsp;Windows&nbsp;NT&nbsp;&nbsp;RAS&nbsp;.所有信息保存在SQL数据库,最后产生一份详细易懂的报告,说明你公司内那个拨号调制解调器的那项服务被刺探。</li>
</ul>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -