<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[MySQL 5.0安装配置的图解]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[数据库技术]]></category>
<pubDate>Wed, 24 Jun 2009 08:19:16 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	<p><font size="3">打开下载的mysql安装文件mysql-5.0.27-win32.zip，双击解压缩，运行&ldquo;setup.exe&rdquo;，出现如下界面：</font></p><br/><div><br /><br/><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5024956-0.jpg" /></font></div><br/><div><br/><div><font size="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mysql安装向导启动，按&ldquo;Next&rdquo;继续 <br /><br/><img style="cursor: pointer" alt="" border="0" src="/attachment/1A502N09-1.jpg" /></font></div><br/></div><br/><div><br /><br/><font size="3">选择安装类型，有&ldquo;Typical（默认）&rdquo;、&ldquo;Complete（完全）&rdquo;、&ldquo;Custom（用户自定义）&rdquo;三个选项，我们选择&ldquo;Custom&rdquo;，有更多的选项，也方便熟悉安装过程</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A50253C-2.jpg" /></font></div><br/><div><br /><br/><font size="3">在&ldquo;Developer Components（开发者部分）&rdquo;上左键单击，选择&ldquo;This feature, and all subfeatures, will be installed on local hard drive.&rdquo;，即&ldquo;此部分，及下属子部分内容，全部安装在本地硬盘上&rdquo;。在上面的&ldquo;MySQL Server（mysql服务器）&rdquo;、&ldquo;Client Programs（mysql客户端程序）&rdquo;、&ldquo;Documentation（文档）&rdquo;也如此操作，以保证安装所有文件。点选&ldquo;Change...&rdquo;，手动指定安装目录。</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5022095-3.jpg" /></font></div><br/><div><br /><br/><font size="3">填上安装目录，我的是&ldquo;F:&#92;Server&#92;MySQL&#92;MySQL Server 5.0&rdquo;，也建议不要放在与操作系统同一分区，这样可以防止系统备份还原的时</font></div><br/><div><font size="3">候，数据被清空。按&ldquo;OK&rdquo;继续。</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5024595-4.jpg" /></font></div><br/><div><br /><br/><font size="3">返回刚才的界面，按&ldquo;Next&rdquo;继续。</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5025325-5.jpg" /></font></div><br/><div><br /><br/><font size="3">确认一下先前的设置，如果有误，按&ldquo;Back&rdquo;返回重做。按&ldquo;Install&rdquo;开始安装。</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A502KH-6.jpg" /></font></div><br/><div><br /><br/><font size="3">正在安装中，请稍候，直到出现下面的界面</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5021307-7.jpg" /></font></div><br/><div><br /><br/><font size="3">这里是询问你是否要注册一个mysql.com的账号，或是使用已有的账号登陆mysql.com，一般不需要了，点选&ldquo;Skip Sign-Up&rdquo;，按&ldquo;Next&rdquo;略过此步骤。</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A502L29-8.jpg" /></font></div><br/><div><br /><br/><font size="3">现在<span style="text-decoration: underline"><strong><span style="color: rgb(0,0,255)">软件</span></strong></span>安装完成了，出现上面的界面，这里有一个很好的功能，mysql配置向导，不用向以前一样，自己手动乱七八糟的配置my.ini了，将 &ldquo;Configure the Mysql Server now&rdquo;前面的勾打上，点&ldquo;Finish&rdquo;结束软件的安装并启动mysql配置向导。</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5021L9-9.jpg" /></font></div><br/><div><br /><br/><font size="3">mysql配置向导启动界面，按&ldquo;Next&rdquo;继续。</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5025022-10.jpg" /></font></div><br/><div><br /><br/><font size="3">选择配置方式，&ldquo;Detailed Configuration（手动精确配置）&rdquo;、&ldquo;Standard Configuration（标准配置）&rdquo;，我们选择&ldquo;Detailed Configuration&rdquo;，方便熟悉配置过程。</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5023358-11.jpg" /></font></div><br/><div><br /><br/><font size="3">选择服务器类型，&ldquo;Developer Machine（开发测试类，mysql占用很少资源）&rdquo;、&ldquo;Server Machine（服务器类型，mysql占用较多资源）&rdquo;、&ldquo;Dedicated MySQL Server Machine（专门的<span style="text-decoration: underline"><strong><span style="color: rgb(0,0,255)">数据库</span></strong></span>服务器，mysql占用所有可用资源）&rdquo;，大家根据自己的类型选择了，一般选&ldquo;Server Machine&rdquo;，不会太少，也不会占满。</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5021039-12.jpg" /></font></div><br/><div><br /><br/><font size="3">选择mysql数据库的大致用途，&ldquo;Multifunctional <span style="text-decoration: underline"><strong><span style="color: rgb(0,0,255)">Database</span></strong></span>（通用多功能型，好）&rdquo;、&ldquo;Transactional Database Only（服务器类型，专注于事务处理，一般）&rdquo;、&ldquo;Non-Transactional Database Only（非事务处理型，较简单，主要做一些监控、记数用，对MyISAM数据类型的支持仅限于non-transactional），随自己的用途而选择了，我这里选择&ldquo;Transactional Database Only&rdquo;，按&ldquo;Next&rdquo;继续。 <img style="cursor: pointer" alt="" border="0" src="/attachment/1A5023Z3-13.jpg" /></font></div><br/><div><br /><br/><font size="3">对InnoDB Tablespace进行配置，就是为InnoDB 数据库文件选择一个存储空间，如果修改了，要记住位置，重装的时候要选择一样的地方，否则可能会造成数据库损坏，当然，对数据库做个备份就没问题了，这里不详述。我这里没有修改，使用用默认位置，直接按&ldquo;Next&rdquo;继续</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5023648-14.jpg" /></font></div><br/><div><br /><br/><font size="3">选择您的网站的一般mysql访问量，同时连接的数目，&ldquo;Decision Support(DSS)/OLAP（20个左右）&rdquo;、&ldquo;Online Transaction Processing(OLTP)（500个左右）&rdquo;、&ldquo;Manual Setting（手动设置，自己输一个数）&rdquo;，我这里选&ldquo;Online Transaction Processing(OLTP)&rdquo;，自己的服务器，应该够用了，按&ldquo;Next&rdquo;继续</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5026195-15.jpg" /></font></div><br/><div><br /><br/><font size="3">是否启用TCP/IP连接，设定端口，如果不启用，就只能在自己的机器上访问mysql数据库了，我这里启用，把前面的勾打上，Port Number：3306，在这个页面上，您还可以选择&ldquo;启用标准模式&rdquo;（Enable Strict Mode），这样MySQL就不会允许细小的语法错误。如果您还是个新手，我建议您取消标准模式以减少麻烦。但熟悉MySQL以后，尽量使用标准模式，因为它可以降低有害数据进入数据库的可能性。按&ldquo;Next&rdquo;继续</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A5021249-16.jpg" /></font></div><br/><div><br /><br/><font size="3">这个比较重要，就是对mysql默认数据库语言编码进行设置，第一个是西文编码，第二个是多字节的通用utf8编码，都不是我们通用的编码，这里选择第三个，然后在Character Set那里选择或填入&ldquo;gbk&rdquo;，当然也可以用&ldquo;gb2312&rdquo;，区别就是gbk的字库容量大，包括了gb2312的所有汉字，并且加上了繁体字、和其它乱七八糟的字&mdash;&mdash;使用mysql的时候，在执行数据操作命令之前运行一次&ldquo;SET NAMES GBK;&rdquo;（运行一次就行了，GBK可以替换为其它值，视这里的设置而定），就可以正常的使用汉字（或其它文字）了，否则不能正常显示汉字。按 &ldquo;Next&rdquo;继续。</font></div><br/><div><font size="3"><img style="cursor: pointer" alt="" border="0" src="/attachment/1A50250H-17.jpg" /></font></div><br/><div><br /><br/><font size="3">选择是否将mysql安装为windows服务，还可以指定Service Name（服务标识名称），是否将mysql的bin目录加入到Windows PATH（加入后，就可以直接使用bin下的文件，而不用指出目录名，比如连接，&ldquo;mysql.exe -uusername -ppassword;&rdquo;就可以了，不用指出mysql.exe的完整地址，很方便），我这里全部打上了勾，Service Name不变。按&ldquo;Next&rdquo;继续。 <img style="cursor: pointer" alt="" border="0" src="/attachment/1A5024X4-18.jpg" /><br /><br/>这一步询问是否要修改默认root用户（超级管理）的密码（默认为空），&ldquo;New root password&rdquo;如果要修改，就在此填入新密码（如果是重装，并且之前已经设置了密码，在这里更改密码可能会出错，请留空，并将&ldquo;Modify Security Settings&rdquo;前面的勾去掉，安装配置完成后另行修改密码），&ldquo;Confirm（再输一遍）&rdquo;内再填一次，防止输错。&ldquo;Enable root access from remote machines（是否允许root用户在其它的机器上登陆，如果要安全，就不要勾上，如果要方便，就勾上它）&rdquo;。最后&ldquo;Create An Anonymous Account（新建一个匿名用户，匿名用户可以连接数据库，不能操作数据，包括查询）&rdquo;，一般就不用勾了，设置完毕，按&ldquo;Next&rdquo;继续。 <img style="cursor: pointer" alt="" border="0" src="/attachment/1A5021643-19.jpg" /></font></div><br/><div><br /><br/><font size="3">确认设置无误，如果有误，按&ldquo;Back&rdquo;返回检查。按&ldquo;Execute&rdquo;使设置生效。 <img style="cursor: pointer" alt="" border="0" src="/attachment/1A5024G3-20.jpg" /></font></div><br/><div><br /><br/><font size="3">设置完毕，按&ldquo;Finish&rdquo;结束mysql的安装与配置&mdash;&mdash;这里有一个比较常见的错误，就是不能&ldquo;Start service&rdquo;，一般出现在以前有安装mysql的服务器上，解决的办法，先保证以前安装的mysql服务器彻底卸载掉了；不行的话，检查是否按上面一步所说，之前的密码是否有修改，照上面的操作；如果依然不行，将mysql安装目录下的data文件夹备份，然后删除，在安装完成后，将安装生成的 data文件夹删除，备份的data文件夹移回来，再重启mysql服务就可以了，这种情况下，可能需要将数据库检查一下，然后修复一次，防止数据出错。</font></div><br/><div><font size="3"><img style="width: 454px; cursor: pointer" alt="" border="0" src="/attachment/1A5026438-21.jpg" /></font></div><br/>Tags - <a href="http://www.dzhope.com/tags/mysql/" rel="tag">mysql</a>
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] MySQL 5.0安装配置的图解]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>