<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>VPS侦探 &#187; MySQL</title>
	<atom:link href="http://www.vpser.net/tag/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.vpser.net</link>
	<description>致力于VPS主机推荐、VPS管理维护、VPS优惠信息及VPS相关的信息共享平台</description>
	<lastBuildDate>Mon, 06 Feb 2012 01:24:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Linux下重置MySQL root密码</title>
		<link>http://www.vpser.net/manage/linux-reset-mysql-root-password.html</link>
		<comments>http://www.vpser.net/manage/linux-reset-mysql-root-password.html#comments</comments>
		<pubDate>Tue, 31 May 2011 01:10:56 +0000</pubDate>
		<dc:creator>VPSer</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysql root密码]]></category>
		<category><![CDATA[重设]]></category>

		<guid isPermaLink="false">http://www.vpser.net/?p=2295</guid>
		<description><![CDATA[有时候你可能会忘记MySQL的root密码，下面vps侦探提供两种方法重置MySQL root密码： 一、手动修改 1、停止MySQL服务 执行：/etc/init.d/mysql stop，你的机器上也不一定/etc/init.d/mysql也可能是/etc/init.d/mysqld 2、跳过验证启动MySQL /usr/local/mysql/bin/mysqld_safe --skip-grant-tables &#62;/dev/null 2&#62;&#38;1 &#38; 注：如果mysqld_safe的位置如果和上面不一样需要修改成你的，如果不清楚可以用find命令查找。 3、重置密码 等一会儿，然后执行：/usr/local/mysql/bin/mysql -u root mysql 出现mysql提示符后输入：update user set password = Password('要设置的密码') where User = 'root'; 回车后执行：flush privileges;    刷新MySQL系统权限相关的表。再执行：exit;  退出。 4、重启MySQL 杀死MySQL进程：killall mysqld 重启MySQL：/etc/init.d/mysql start 二、使用重置脚本 wget http://soft.vpser.net/lnmp/ext/reset_mysql_root_password.sh;sh reset_mysql_root_password.sh 适合lnmp或MySQL管理脚本在/etc/init.d/mysql且mysql安装在/usr/local/mysql/的。否则需要修改脚本后再执行sh reset_mysql_root_password.sh。 如有问题欢迎在本文下方留言或到VPS论坛交流反馈。 原创文章，谢绝转载！ 相关文章：Linux VPS/服务器上轻松导入、导出MySQL数据库如何关闭MySQL日志，删除mysql-bin.0000*日志文件安装完kloxo后不支持Mysql,GD问题的解决方法Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境VPS主机上MySQL数据库的优化VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化 © VPSer for VPS侦探, 2011. &#124; Permalink &#124; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vpser.net/manage/linux-reset-mysql-root-password.html" target="_blank"><img class="alignnone size-full wp-image-2296" title="mysql" src="http://www.vpser.net/uploads/2011/05/mysql.jpg" alt="" width="138" height="81" /></a></p>
<p>有时候你可能会忘记MySQL的root密码，下面<a href="http://www.vpser.net" target="_blank">vps侦探</a>提供两种方法<a href="http://www.vpser.net/manage/linux-reset-mysql-root-password.html" target="_blank">重置MySQL root密码</a>：</p>
<h2>一、手动修改</h2>
<h3>1、停止MySQL服务</h3>
<p>执行：/etc/init.d/mysql stop，你的机器上也不一定/etc/init.d/mysql也可能是/etc/init.d/mysqld<span id="more-2295"></span></p>
<h3>2、跳过验证启动MySQL</h3>
<p>/usr/local/mysql/bin/mysqld_safe --skip-grant-tables &gt;/dev/null 2&gt;&amp;1 &amp;</p>
<p>注：如果mysqld_safe的位置如果和上面不一样需要修改成你的，如果不清楚可以用find命令查找。</p>
<h3>3、重置密码</h3>
<p>等一会儿，然后执行：/usr/local/mysql/bin/mysql -u root mysql</p>
<p>出现mysql提示符后输入：update user set password = Password('要设置的密码') where User = 'root';</p>
<p>回车后执行：flush privileges;    刷新MySQL系统权限相关的表。再执行：exit;  退出。</p>
<h3>4、重启MySQL</h3>
<p>杀死MySQL进程：killall mysqld</p>
<p>重启MySQL：/etc/init.d/mysql start</p>
<h2>二、使用重置脚本</h2>
<p>wget <a href="http://soft.vpser.net/lnmp/ext/reset_mysql_root_password.sh" target="_blank">http://soft.vpser.net/lnmp/ext/reset_mysql_root_password.sh</a>;sh reset_mysql_root_password.sh</p>
<p>适合lnmp或MySQL管理脚本在/etc/init.d/mysql且mysql安装在/usr/local/mysql/的。否则需要修改脚本后再执行sh reset_mysql_root_password.sh。</p>
<p>如有问题欢迎在本文下方留言或到<a href="http://bbs.vpser.net/" target="_blank">VPS论坛</a>交流反馈。</p>
<p>原创文章，谢绝转载！</p>
<h2  class="related_post_title">相关文章：</h2><ul class="related_post"><li><a href="http://www.vpser.net/manage/mysql-import-export.html" title="Linux VPS/服务器上轻松导入、导出MySQL数据库">Linux VPS/服务器上轻松导入、导出MySQL数据库</a></li><li><a href="http://www.vpser.net/manage/delete-mysql-mysql-bin-0000-logs.html" title="如何关闭MySQL日志，删除mysql-bin.0000*日志文件">如何关闭MySQL日志，删除mysql-bin.0000*日志文件</a></li><li><a href="http://www.vpser.net/vps-cp/kloxo-dont-support-mysql-gd.html" title="安装完kloxo后不支持Mysql,GD问题的解决方法">安装完kloxo后不支持Mysql,GD问题的解决方法</a></li><li><a href="http://www.vpser.net/build/debian-vps-web-server.html" title="Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境">Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境</a></li><li><a href="http://www.vpser.net/opt/vps-mysql-opt.html" title="VPS主机上MySQL数据库的优化">VPS主机上MySQL数据库的优化</a></li><li><a href="http://www.vpser.net/build/vps-nginx-mysql-php.html" title="VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化">VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化</a></li></ul><hr />
<p><small>© VPSer for <a href="http://www.vpser.net">VPS侦探</a>, 2011. |
<a href="http://www.vpser.net/manage/linux-reset-mysql-root-password.html">Permalink</a> |
<a href="http://www.vpser.net/manage/linux-reset-mysql-root-password.html#comments">No comment</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.vpser.net/manage/linux-reset-mysql-root-password.html&title=Linux下重置MySQL root密码">del.icio.us</a>
<br/>
Post tags: <a href="http://www.vpser.net/tag/mysql" rel="tag">MySQL</a>, <a href="http://www.vpser.net/tag/mysql-root%e5%af%86%e7%a0%81" rel="tag">mysql root密码</a>, <a href="http://www.vpser.net/tag/%e9%87%8d%e8%ae%be" rel="tag">重设</a><br/>
<br/>
<img src="http://www.vpser.net/images/tuijian.gif"> <a href="http://www.vpser.net/usa-vps/">美国VPS推荐</a>  | <a href="http://shop63846532.taobao.com/">军哥代购 - 提供美国及海外VPS/VPN/域名代购，美元/欧元代付</a> QQ：503228080
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vpser.net/manage/linux-reset-mysql-root-password.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux VPS/服务器上轻松导入、导出MySQL数据库</title>
		<link>http://www.vpser.net/manage/mysql-import-export.html</link>
		<comments>http://www.vpser.net/manage/mysql-import-export.html#comments</comments>
		<pubDate>Mon, 06 Dec 2010 01:03:28 +0000</pubDate>
		<dc:creator>VPSer</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[备份]]></category>
		<category><![CDATA[导入]]></category>
		<category><![CDATA[导出]]></category>
		<category><![CDATA[数据库]]></category>

		<guid isPermaLink="false">http://www.vpser.net/?p=1739</guid>
		<description><![CDATA[随着网站的运行MySQL数据库也越来越大，备份问题也日益凸显，使用phpmyadmin导出或导入时可能会因为超时文件过大等原因无法导入或导出。下面VPS侦探说一下几个解决方法： MySQL数据库导出 方法1:mysqldump命令 执行命令： /usr/local/mysql/bin/mysqldump -u 用户名 -p 数据库名 &#62; 文件名 如果数据库用户名有密码密码，执行后会提示输入密码。如果数据库用户名没有密码，就将命令中的“-p”参数删除。 注意：推荐使用MySQL root帐号进行操作，因为有些数据库可能设置了只能对应的用户进行操作。 方法2:phpmyadmin phpmyadmin支持将数据库文件直接备份到配置文件指定的目录，默认安装的lnmp使用了修改后的配置，可以将数据库直接备份到/home/wwwroot/phpmyadmin/save/ 下面，然后用户通过http或者ftp等方式下载即可。暂时没有测试过比较大的数据库，lnmp的用户可以测试一下给我反馈。 方法3：第三方软件 如：帝国备份王，专门为MYSQL大数据的备份与导入而设计的稳定高效软件,系统采用分卷备份与导入,理论上可备份任何大小的数据库。据网上的反馈看还是不错的，安装使用方法。 MySQL数据库导入 方法1：mysql命令 执行命令： /usr/local/mysql/bin/mysql -u 用户名 -p 数据库名 &#60; 文件名 参数与mysqldump的使用一样。 注意：导入的数据库名需要已经存在。 方法2：phpmyadmin phpmyadmin可以将位于/home/wwwroot/phpmyadmin/upload/ 导入到指定的数据库里，可以上传数据库备份文件到/home/wwwroot/phpmyadmin/upload/这个目录进行导入。 方法3：第三方软件 如：帝国备份王。详细的帝国备份王安装使用方法点击这里。 如果有任何问题可以在本文留言，或者到vps论坛发帖求助。原创文章，谢绝转载。 相关文章：Linux VPS/服务器 网站及数据库自动本地备份并FTP上传备份脚本Linux VPS上自动备份文件并发送到Gmail (适用G级数据的备份)(转)VPS主机上备份网站和数据库Linux下多线程下载工具 &#8211; AxelBurstNet 2011年6月Windows和Linux VPS优惠码Linux下重置MySQL root密码Linux VPS/服务器上用Crontab来实现VPS自动化Linux上iptables防火墙的基本应用教程123Systems创新低价128内存Linux VPS仅需10美元/年YardVPS Tree Xen Linux和GRASS Windows方案 限时48小时9折优惠码 © VPSer for [...]]]></description>
			<content:encoded><![CDATA[<p><a href=" http://www.vpser.net/manage/mysql-import-export.html"><img class="size-full wp-image-1765 alignnone" title="Mysql_logo" src="http://www.vpser.net/uploads/2010/12/Mysql_logo.png" alt="" width="122" height="64" /></a></p>
<p>随着网站的运行MySQL数据库也越来越大，备份问题也日益凸显，使用phpmyadmin导出或导入时可能会因为超时文件过大等原因无法<a href="http://www.vpser.net/manage/mysql-import-export.html" target="_blank">导入或导出</a>。下面VPS侦探说一下几个解决方法：</p>
<h2>MySQL数据库导出</h2>
<h3>方法1:mysqldump命令</h3>
<p>执行命令： <em>/usr/local/mysql/bin/mysqldump -u 用户名 -p 数据库名 &gt; 文件名<span id="more-1739"></span></em><br />
<em> </em>如果数据库用户名有密码密码，执行后会提示输入密码。如果数据库用户名没有密码，就将命令中的“-p”参数删除。</p>
<p>注意：推荐使用MySQL root帐号进行操作，因为有些数据库可能设置了只能对应的用户进行操作。</p>
<h3>方法2:phpmyadmin</h3>
<p><a href="http://www.vpser.net/manage/mysql-import-export.html" target="_blank"><img class="size-full wp-image-1762 alignnone" title="mysql-phpmyadmin-export" src="http://www.vpser.net/uploads/2010/12/mysql-phpmyadmin-export.jpg" alt="" width="385" height="130" /></a></p>
<p>phpmyadmin支持将数据库文件直接备份到配置文件指定的目录，默认安装的lnmp使用了修改后的配置，可以将数据库直接备份到/home/wwwroot/phpmyadmin/save/ 下面，然后用户通过http或者ftp等方式下载即可。暂时没有测试过比较大的数据库，<a href="http://lnmp.org" target="_blank">lnmp</a>的用户可以测试一下给我反馈。</p>
<h3>方法3：第三方软件</h3>
<p>如：帝国备份王，专门为MYSQL大数据的备份与导入而设计的稳定高效软件,系统采用分卷备份与导入,理论上可备份任何大小的数据库。据网上的反馈看还是不错的，<a href="http://www.phome.net/ebak2010/doc/docutf.html#setup" target="_blank">安装使用方法</a>。</p>
<h2>MySQL数据库导入</h2>
<h3>方法1：mysql命令</h3>
<p>执行命令： <em>/usr/local/mysql/bin/mysql -u 用户名 -p 数据库名 &lt; 文件名</em></p>
<p><em></em>参数与mysqldump的使用一样。</p>
<p>注意：导入的数据库名需要已经存在。</p>
<h3>方法2：phpmyadmin</h3>
<p><a href="http://www.vpser.net/manage/mysql-import-export.html" target="_blank"><img class="size-full wp-image-1764 alignnone" title="mysql-phpmyadmin-import" src="http://www.vpser.net/uploads/2010/12/mysql-phpmyadmin-import.jpg" alt="" width="409" height="194" /></a></p>
<p>phpmyadmin可以将位于/home/wwwroot/phpmyadmin/upload/ 导入到指定的数据库里，可以上传数据库备份文件到/home/wwwroot/phpmyadmin/upload/这个目录进行导入。</p>
<h3>方法3：第三方软件</h3>
<p>如：帝国备份王。详细的<a href="http://www.phome.net/ebak2010/doc/docutf.html#setup" target="_blank">帝国备份王安装使用方法点击这里</a>。</p>
<p>如果有任何问题可以在本文留言，或者到<a href="http://bbs.vpser.net/" target="_blank">vps论坛</a>发帖求助。原创文章，谢绝转载。</p>
<h2  class="related_post_title">相关文章：</h2><ul class="related_post"><li><a href="http://www.vpser.net/security/linux-autobackup-ftp.html" title="Linux VPS/服务器 网站及数据库自动本地备份并FTP上传备份脚本">Linux VPS/服务器 网站及数据库自动本地备份并FTP上传备份脚本</a></li><li><a href="http://www.vpser.net/security/vps-auto-bakup-send-by-gmail.html" title="Linux VPS上自动备份文件并发送到Gmail (适用G级数据的备份)(转)">Linux VPS上自动备份文件并发送到Gmail (适用G级数据的备份)(转)</a></li><li><a href="http://www.vpser.net/security/vps-backup-web-mysql.html" title="VPS主机上备份网站和数据库">VPS主机上备份网站和数据库</a></li><li><a href="http://www.vpser.net/manage/axel.html" title="Linux下多线程下载工具 &#8211; Axel">Linux下多线程下载工具 &#8211; Axel</a></li><li><a href="http://www.vpser.net/coupons/burstnet-2011-june-windows-linux-vps-coupons.html" title="BurstNet 2011年6月Windows和Linux VPS优惠码">BurstNet 2011年6月Windows和Linux VPS优惠码</a></li><li><a href="http://www.vpser.net/manage/linux-reset-mysql-root-password.html" title="Linux下重置MySQL root密码">Linux下重置MySQL root密码</a></li><li><a href="http://www.vpser.net/manage/crontab.html" title="Linux VPS/服务器上用Crontab来实现VPS自动化">Linux VPS/服务器上用Crontab来实现VPS自动化</a></li><li><a href="http://www.vpser.net/security/linux-iptables.html" title="Linux上iptables防火墙的基本应用教程">Linux上iptables防火墙的基本应用教程</a></li><li><a href="http://www.vpser.net/coupons/123systems-128m-vps-10usd-yearly.html" title="123Systems创新低价128内存Linux VPS仅需10美元/年">123Systems创新低价128内存Linux VPS仅需10美元/年</a></li><li><a href="http://www.vpser.net/coupons/yardvps-tree-grass-2010-12-10off.html" title="YardVPS Tree Xen Linux和GRASS Windows方案 限时48小时9折优惠码">YardVPS Tree Xen Linux和GRASS Windows方案 限时48小时9折优惠码</a></li></ul><hr />
<p><small>© VPSer for <a href="http://www.vpser.net">VPS侦探</a>, 2010. |
<a href="http://www.vpser.net/manage/mysql-import-export.html">Permalink</a> |
<a href="http://www.vpser.net/manage/mysql-import-export.html#comments">8 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.vpser.net/manage/mysql-import-export.html&title=Linux VPS/服务器上轻松导入、导出MySQL数据库">del.icio.us</a>
<br/>
Post tags: <a href="http://www.vpser.net/tag/linux" rel="tag">Linux</a>, <a href="http://www.vpser.net/tag/mysql" rel="tag">MySQL</a>, <a href="http://www.vpser.net/tag/%e5%a4%87%e4%bb%bd" rel="tag">备份</a>, <a href="http://www.vpser.net/tag/%e5%af%bc%e5%85%a5" rel="tag">导入</a>, <a href="http://www.vpser.net/tag/%e5%af%bc%e5%87%ba" rel="tag">导出</a>, <a href="http://www.vpser.net/tag/%e6%95%b0%e6%8d%ae%e5%ba%93" rel="tag">数据库</a><br/>
<br/>
<img src="http://www.vpser.net/images/tuijian.gif"> <a href="http://www.vpser.net/usa-vps/">美国VPS推荐</a>  | <a href="http://shop63846532.taobao.com/">军哥代购 - 提供美国及海外VPS/VPN/域名代购，美元/欧元代付</a> QQ：503228080
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vpser.net/manage/mysql-import-export.html/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>如何关闭MySQL日志，删除mysql-bin.0000*日志文件</title>
		<link>http://www.vpser.net/manage/delete-mysql-mysql-bin-0000-logs.html</link>
		<comments>http://www.vpser.net/manage/delete-mysql-mysql-bin-0000-logs.html#comments</comments>
		<pubDate>Sat, 06 Nov 2010 02:47:25 +0000</pubDate>
		<dc:creator>VPSer</dc:creator>
				<category><![CDATA[VPS管理维护]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySql-bin.0000]]></category>
		<category><![CDATA[日志]]></category>

		<guid isPermaLink="false">http://www.vpser.net/?p=1624</guid>
		<description><![CDATA[LNMP一键安装包安装的MySQL默认是开启了日志文件的，如果数据操作比较频繁就会产生大量的日志，在/usr/local/mysql/var/下面产生mysql-bin.0000* 类似的文件，而且一般都在几十MB到几个GB，更甚会吃掉整个硬盘空间，从来导致mysql无法启动或报错，如vps论坛用户的反馈。 如何关闭MySQL的日志功能： 删除日志： 执行：/usr/local/mysql/bin/mysql -u root -p 输入密码登录后再执行：reset master; 修改/etc/my.cnf 文件，找到 log-bin=mysql-bin binlog_format=mixed 再这两行前面加上#，将其注释掉，再执行/etc/init.d/mysql restart即可。 本文以LNMP一件安装包安装的环境为例除MySQL重启命令和配置文件路径可能略有不同，其他一样。 相关文章：Linux下重置MySQL root密码Nginx日志切割脚本Linux VPS/服务器上轻松导入、导出MySQL数据库安装完kloxo后不支持Mysql,GD问题的解决方法关闭lxadmin自动生成日志文件的功能Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境VPS主机上MySQL数据库的优化VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化 © VPSer for VPS侦探, 2010. &#124; Permalink &#124; 6 comments &#124; Add to del.icio.us Post tags: MySQL, MySql-bin.0000, 日志 美国VPS推荐 &#124; 军哥代购 - 提供美国及海外VPS/VPN/域名代购，美元/欧元代付 QQ：503228080]]></description>
			<content:encoded><![CDATA[<p><a href="http://lnmp.org" target="_blank">LNMP一键安装包</a>安装的MySQL默认是开启了日志文件的，如果数据操作比较频繁就会产生大量的日志，在/usr/local/mysql/var/下面产生mysql-bin.0000* 类似的文件，而且一般都在几十MB到几个GB，更甚会吃掉整个硬盘空间，从来导致mysql无法启动或报错，如<a href="http://bbs.vpser.net/viewthread.php?tid=1776" target="_blank">vps论坛用户的反馈</a>。</p>
<p>如何关闭MySQL的日志功能：</p>
<p>删除日志：</p>
<p><span id="more-1624"></span></p>
<p>执行：/usr/local/mysql/bin/mysql -u root -p</p>
<p>输入密码登录后再执行：reset master;</p>
<p>修改/etc/my.cnf 文件，找到</p>
<p>log-bin=mysql-bin<br />
binlog_format=mixed</p>
<p>再这两行前面加上<strong>#</strong>，将其注释掉，再执行/etc/init.d/mysql restart即可。</p>
<p>本文以<a href="http://lnmp.org" target="_blank">LNMP一件安装包</a>安装的环境为例除MySQL重启命令和配置文件路径可能略有不同，其他一样。</p>
<h2  class="related_post_title">相关文章：</h2><ul class="related_post"><li><a href="http://www.vpser.net/manage/linux-reset-mysql-root-password.html" title="Linux下重置MySQL root密码">Linux下重置MySQL root密码</a></li><li><a href="http://www.vpser.net/manage/cut-nginx-log-files.html" title="Nginx日志切割脚本">Nginx日志切割脚本</a></li><li><a href="http://www.vpser.net/manage/mysql-import-export.html" title="Linux VPS/服务器上轻松导入、导出MySQL数据库">Linux VPS/服务器上轻松导入、导出MySQL数据库</a></li><li><a href="http://www.vpser.net/vps-cp/kloxo-dont-support-mysql-gd.html" title="安装完kloxo后不支持Mysql,GD问题的解决方法">安装完kloxo后不支持Mysql,GD问题的解决方法</a></li><li><a href="http://www.vpser.net/opt/lxadmin-log-file.html" title="关闭lxadmin自动生成日志文件的功能">关闭lxadmin自动生成日志文件的功能</a></li><li><a href="http://www.vpser.net/build/debian-vps-web-server.html" title="Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境">Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境</a></li><li><a href="http://www.vpser.net/opt/vps-mysql-opt.html" title="VPS主机上MySQL数据库的优化">VPS主机上MySQL数据库的优化</a></li><li><a href="http://www.vpser.net/build/vps-nginx-mysql-php.html" title="VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化">VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化</a></li></ul><hr />
<p><small>© VPSer for <a href="http://www.vpser.net">VPS侦探</a>, 2010. |
<a href="http://www.vpser.net/manage/delete-mysql-mysql-bin-0000-logs.html">Permalink</a> |
<a href="http://www.vpser.net/manage/delete-mysql-mysql-bin-0000-logs.html#comments">6 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.vpser.net/manage/delete-mysql-mysql-bin-0000-logs.html&title=如何关闭MySQL日志，删除mysql-bin.0000*日志文件">del.icio.us</a>
<br/>
Post tags: <a href="http://www.vpser.net/tag/mysql" rel="tag">MySQL</a>, <a href="http://www.vpser.net/tag/mysql-bin-0000" rel="tag">MySql-bin.0000</a>, <a href="http://www.vpser.net/tag/%e6%97%a5%e5%bf%97" rel="tag">日志</a><br/>
<br/>
<img src="http://www.vpser.net/images/tuijian.gif"> <a href="http://www.vpser.net/usa-vps/">美国VPS推荐</a>  | <a href="http://shop63846532.taobao.com/">军哥代购 - 提供美国及海外VPS/VPN/域名代购，美元/欧元代付</a> QQ：503228080
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vpser.net/manage/delete-mysql-mysql-bin-0000-logs.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>安装完kloxo后不支持Mysql,GD问题的解决方法</title>
		<link>http://www.vpser.net/vps-cp/kloxo-dont-support-mysql-gd.html</link>
		<comments>http://www.vpser.net/vps-cp/kloxo-dont-support-mysql-gd.html#comments</comments>
		<pubDate>Thu, 06 May 2010 16:35:31 +0000</pubDate>
		<dc:creator>VPSer</dc:creator>
				<category><![CDATA[VPS控制面板]]></category>
		<category><![CDATA[extension_dir]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[Kloxo]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.vpser.net/?p=1120</guid>
		<description><![CDATA[Kloxo是一款比较适合Linux新手使用的轻量级VPS控制面板；最近在安装使用Kloxo时遇到了安装完Kloxo后遇到无法连接Mysql，也不支持GD。 根据之前对Kloxo的了解应该是安装的64位CentOS的原因。 /etc/php.ini中extension_dir = /usr/lib/php/modules 如果系统是32位，则会存在这个目录，如果64位就没有，但是位于/usr/lib64/php/modules ，但是如果仅仅修改extension_dir是不够的。 第一种解决方法：直接重装为32位CentOS，再重新安装Kloxo。 第二种方法：创建软连接，将/usr/lib/php/指向到/usr/lib64/php/ 执行： ln -s /usr/lib64/php/ /usr/lib 重启Apache： /etc/rc.d/init.d/httpd restart 再去检查一遍环境，现在显示都支持了。 相关文章：Linux下重置MySQL root密码Linux VPS/服务器上轻松导入、导出MySQL数据库如何关闭MySQL日志，删除mysql-bin.0000*日志文件去除Kloxo(原lxadmin)域名个数限制的方法Kloxo 安装完(network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)错误解决方法Linode VPS 添加多IP/设置静态IP(Kloxo no_ip_address解决方法)CentOS Linux VPS Kloxo/Lxadmin虚拟主机控制面板安装教程Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境VPS主机上MySQL数据库的优化VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化 © VPSer for VPS侦探, 2010. &#124; Permalink &#124; 2 comments &#124; Add to del.icio.us Post tags: extension_dir, gd, Kloxo, MySQL 美国VPS推荐 &#124; 军哥代购 [...]]]></description>
			<content:encoded><![CDATA[<p>Kloxo是一款比较适合Linux新手使用的轻量级VPS控制面板；最近在<a href="http://www.vpser.net/vps-cp/centos-linux-vps-kloxol-xadmin.html" target="_blank">安装使用Kloxo</a>时遇到了安装完Kloxo后遇到无法连接Mysql，也不支持GD。</p>
<p>根据之前对Kloxo的了解应该是安装的64位CentOS的原因。</p>
<p>/etc/php.ini中extension_dir = /usr/lib/php/modules 如果系统是32位，则会存在这个目录，如果64位就没有，但是位于/usr/lib64/php/modules ，但是如果仅仅修改extension_dir是不够的。</p>
<p>第一种解决方法：直接重装为32位CentOS，再重新安装Kloxo。<span id="more-1120"></span></p>
<p>第二种方法：创建软连接，将/usr/lib/php/指向到/usr/lib64/php/</p>
<p>执行： ln -s /usr/lib64/php/ /usr/lib</p>
<p>重启Apache： /etc/rc.d/init.d/httpd restart</p>
<p>再去检查一遍环境，现在显示都支持了。</p>
<h2  class="related_post_title">相关文章：</h2><ul class="related_post"><li><a href="http://www.vpser.net/manage/linux-reset-mysql-root-password.html" title="Linux下重置MySQL root密码">Linux下重置MySQL root密码</a></li><li><a href="http://www.vpser.net/manage/mysql-import-export.html" title="Linux VPS/服务器上轻松导入、导出MySQL数据库">Linux VPS/服务器上轻松导入、导出MySQL数据库</a></li><li><a href="http://www.vpser.net/manage/delete-mysql-mysql-bin-0000-logs.html" title="如何关闭MySQL日志，删除mysql-bin.0000*日志文件">如何关闭MySQL日志，删除mysql-bin.0000*日志文件</a></li><li><a href="http://www.vpser.net/vps-cp/kloxo-domian-limited.html" title="去除Kloxo(原lxadmin)域名个数限制的方法">去除Kloxo(原lxadmin)域名个数限制的方法</a></li><li><a href="http://www.vpser.net/manage/kloxo-network-c-336-ssl-error.html" title="Kloxo 安装完(network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)错误解决方法">Kloxo 安装完(network.c.336) SSL: error:00000000:lib(0):func(0):reason(0)错误解决方法</a></li><li><a href="http://www.vpser.net/manage/linode-vps-add-ip.html" title="Linode VPS 添加多IP/设置静态IP(Kloxo no_ip_address解决方法)">Linode VPS 添加多IP/设置静态IP(Kloxo no_ip_address解决方法)</a></li><li><a href="http://www.vpser.net/vps-cp/centos-linux-vps-kloxol-xadmin.html" title="CentOS Linux VPS Kloxo/Lxadmin虚拟主机控制面板安装教程">CentOS Linux VPS Kloxo/Lxadmin虚拟主机控制面板安装教程</a></li><li><a href="http://www.vpser.net/build/debian-vps-web-server.html" title="Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境">Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境</a></li><li><a href="http://www.vpser.net/opt/vps-mysql-opt.html" title="VPS主机上MySQL数据库的优化">VPS主机上MySQL数据库的优化</a></li><li><a href="http://www.vpser.net/build/vps-nginx-mysql-php.html" title="VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化">VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化</a></li></ul><hr />
<p><small>© VPSer for <a href="http://www.vpser.net">VPS侦探</a>, 2010. |
<a href="http://www.vpser.net/vps-cp/kloxo-dont-support-mysql-gd.html">Permalink</a> |
<a href="http://www.vpser.net/vps-cp/kloxo-dont-support-mysql-gd.html#comments">2 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.vpser.net/vps-cp/kloxo-dont-support-mysql-gd.html&title=安装完kloxo后不支持Mysql,GD问题的解决方法">del.icio.us</a>
<br/>
Post tags: <a href="http://www.vpser.net/tag/extension_dir" rel="tag">extension_dir</a>, <a href="http://www.vpser.net/tag/gd" rel="tag">gd</a>, <a href="http://www.vpser.net/tag/kloxo" rel="tag">Kloxo</a>, <a href="http://www.vpser.net/tag/mysql" rel="tag">MySQL</a><br/>
<br/>
<img src="http://www.vpser.net/images/tuijian.gif"> <a href="http://www.vpser.net/usa-vps/">美国VPS推荐</a>  | <a href="http://shop63846532.taobao.com/">军哥代购 - 提供美国及海外VPS/VPN/域名代购，美元/欧元代付</a> QQ：503228080
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vpser.net/vps-cp/kloxo-dont-support-mysql-gd.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境</title>
		<link>http://www.vpser.net/build/debian-vps-web-server.html</link>
		<comments>http://www.vpser.net/build/debian-vps-web-server.html#comments</comments>
		<pubDate>Fri, 24 Apr 2009 08:48:07 +0000</pubDate>
		<dc:creator>VPSer</dc:creator>
				<category><![CDATA[服务器环境搭建]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Lighttpd]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.vpser.net/?p=255</guid>
		<description><![CDATA[第一步 把自己的VPS系统切换成Debian系统（据说Debian 4.0目前是BUG最少最稳定的系统之一，虽然功能没有CentOS强大，但够用了）： 1.0 打开HyperVM控制面板 管理VPS，成功登陆后； 1.1.0 选择Rebuild   1.1.1 选择VPS操作系统为Debian 并勾选 “Confirm Rebuild”.然后点击“Update”按钮完成系统重新安装.     【提示】每隔10分钟可以重新安装一次. 1.2.0 OK让我们登陆VPS服务器.使用PuTTY工具登陆我们的VPS. 打开PuTTY输入服务器IP地址.端口，ssh连接方式选择.然后点击“open”按钮登陆服务器   首次连接出现交换密匙提示 点击是（OK）.   接着出现登陆界面 输入用户名和密码 （小技巧：密码先复制下来.在输入密码的地方右击即可.免去手工输入的烦恼） 给一个 Linux常用信息查看命令参考（不看也没有关系.） http://blog.licess.cn/linux-info-command/ 退出服务器的指令 exit 输入exit  回车即可断开连接.   ok 登陆后.让我开始安装WEB环境把. 2.0 安装前更新下Debian服务器. 使用命令 apt-get update   2.1.0 开始安装MYSQL5.0 输入命令 apt-get install mysql-server mysql-client 中途出现 “Do you want to [...]]]></description>
			<content:encoded><![CDATA[<p><strong><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-6.png"></a>第一步 把自己的VPS系统切换成Debian系统</strong>（据说Debian 4.0目前是BUG最少最稳定的系统之一，虽然功能没有CentOS强大，但够用了）：</p>
<p>1.0 打开HyperVM控制面板 管理VPS，成功登陆后；</p>
<p>1.1.0 选择Rebuild</p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-2.png" target="_blank"><img class="alignnone size-full wp-image-256" title="debian-webserver-2" src="http://www.vpser.net/uploads/2009/04/debian-webserver-2.png" alt="debian-webserver-2" width="479" height="215" /></a> <span id="more-255"></span></p>
<p>1.1.1 选择VPS操作系统为Debian 并勾选 “Confirm Rebuild”.然后点击“Update”按钮完成系统重新安装.</p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-3.png" target="_blank"><img class="alignnone size-full wp-image-257" title="debian-webserver-3" src="http://www.vpser.net/uploads/2009/04/debian-webserver-3.png" alt="debian-webserver-3" width="508" height="186" /></a> </p>
<p> </p>
<p>【提示】每隔10分钟可以重新安装一次.</p>
<p>1.2.0 OK让我们登陆VPS服务器.使用PuTTY工具登陆我们的VPS.</p>
<p>打开PuTTY输入服务器IP地址.端口，ssh连接方式选择.然后点击“open”按钮登陆服务器</p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-4.png" target="_blank"><img class="alignnone size-full wp-image-258" title="debian-webserver-4" src="http://www.vpser.net/uploads/2009/04/debian-webserver-4.png" alt="debian-webserver-4" width="460" height="446" /></a> </p>
<p>首次连接出现交换密匙提示 点击是（OK）.</p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-5.png" target="_blank"><img class="alignnone size-full wp-image-259" title="debian-webserver-5" src="http://www.vpser.net/uploads/2009/04/debian-webserver-5.png" alt="debian-webserver-5" width="538" height="340" /></a> </p>
<p>接着出现登陆界面 输入用户名和密码 （小技巧：密码先复制下来.在输入密码的地方右击即可.免去手工输入的烦恼）</p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-6.png" target="_blank"><img class="alignnone size-full wp-image-260" title="debian-webserver-6" src="http://www.vpser.net/uploads/2009/04/debian-webserver-6.png" alt="debian-webserver-6" width="549" height="347" /></a></p>
<p>给一个 <a href="http://blog.licess.cn/linux-info-commandlinux-info-command/" target="_blank">Linux常用信息查看命令</a>参考（不看也没有关系.）</p>
<p><a href="http://blog.licess.cn/linux-info-commandlinux-info-command/">http://blog.licess.cn/linux-info-command/</a></p>
<p>退出服务器的指令 exit</p>
<p>输入exit  回车即可断开连接.</p>
<p> </p>
<p>ok 登陆后.让我开始安装WEB环境把.</p>
<p><strong>2.0 安装前更新下Debian服务器.</strong></p>
<p>使用命令</p>
<blockquote><p>apt-get update</p></blockquote>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-7.png" target="_blank"><img class="alignnone size-full wp-image-261" title="debian-webserver-7" src="http://www.vpser.net/uploads/2009/04/debian-webserver-7.png" alt="debian-webserver-7" width="493" height="305" /></a> </p>
<p>2.1.0 开始安装MYSQL5.0</p>
<p>输入命令</p>
<blockquote><p>apt-get install mysql-server mysql-client</p></blockquote>
<p>中途出现 “Do you want to continue [Y/n]?”</p>
<p>输入 y  回车继续安装</p>
<p>2.1.1 查看MYSQL是否工作.</p>
<p>输入命令</p>
<blockquote><p>netstat -tap | grep mysql</p></blockquote>
<p>2.1.2 设置MySql 管理员（root）密码</p>
<p>命令</p>
<blockquote><p>mysqladmin -u root password 你的密码<br />
如果想把root 密码设置为 anqun 则这样书写<br />
mysqladmin -u root password 1234</p></blockquote>
<p>2.1.3 使用ROOT帐户登陆MYSQL.</p>
<p>命令</p>
<blockquote><p>mysql -u root –p</p></blockquote>
<p>提示输入密码.回车即可成功登陆MYSQL.</p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-8.png" target="_blank"><img class="alignnone size-full wp-image-262" title="debian-webserver-8" src="http://www.vpser.net/uploads/2009/04/debian-webserver-8.png" alt="debian-webserver-8" width="512" height="137" /></a> </p>
<p>MySQL安装成功后我们开始安装WWW服务器Lighttpd</p>
<p><strong>2.2.0 安装Lighttpd</strong></p>
<p>安装命令</p>
<blockquote><p>apt-get install lighttpd</p></blockquote>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-9.png" target="_blank"><img class="alignnone size-full wp-image-263" title="debian-webserver-9" src="http://www.vpser.net/uploads/2009/04/debian-webserver-9.png" alt="debian-webserver-9" width="488" height="423" /></a> </p>
<p>这时打开你的独立IP地址 就可以看见欢迎页面了.安装成功！</p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-10.png" target="_blank"><img class="alignnone size-full wp-image-264" title="debian-webserver-10" src="http://www.vpser.net/uploads/2009/04/debian-webserver-10.png" alt="debian-webserver-10" width="539" height="383" /></a> </p>
<p>lighttpd默认网页文件夹</p>
<blockquote><p>/var/www</p></blockquote>
<p>lighttpd配置文件</p>
<blockquote><p>/etc/lighttpd/lighttpd.conf</p></blockquote>
<p>OK Lighttpd 既然安装成功后 我们就安装PHP让 Lighttpd支持PHP!</p>
<p>2.2.1 安装PHP.</p>
<p>命令</p>
<blockquote><p>apt-get install php5-cgi</p></blockquote>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-11.png" target="_blank"><img class="alignnone size-full wp-image-265" title="debian-webserver-11" src="http://www.vpser.net/uploads/2009/04/debian-webserver-11.png" alt="debian-webserver-11" width="426" height="484" /></a> </p>
<p>2.2.2 让Lighttpd支持PHP</p>
<p>我们要修改2个文件</p>
<ol>
<li> 
<ol>
<li>/etc/php5/cgi/php.ini</li>
<li>/etc/lighttpd/lighttpd.conf</li>
</ol>
</li>
</ol>
<p>修改方法通常使用VI指令..但是我不会用..还好HyperVM控制面板给我们提够了在线系统文件管理.</p>
<p>回到HyperVM控制面板 点击"File Manager"进入在线文件管理.</p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-12.png" target="_blank"><img class="alignnone size-full wp-image-266" title="debian-webserver-12" src="http://www.vpser.net/uploads/2009/04/debian-webserver-12.png" alt="debian-webserver-12" width="477" height="125" /></a> </p>
<p>我们先找到/etc/php5/cgi/php.ini</p>
<p>打开他转到edit编辑状态.</p>
<p>在最后一行插入</p>
<blockquote><p>cgi.fix_pathinfo = 1</p></blockquote>
<p><span style="color: #ff0000;">注:在此代码后，一定要再空出一行！</span></p>
<p>然后保存</p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-13.png" target="_blank"><img class="alignnone size-full wp-image-267" title="debian-webserver-13" src="http://www.vpser.net/uploads/2009/04/debian-webserver-13.png" alt="debian-webserver-13" width="486" height="372" /></a> </p>
<p>接着用同样的方法编辑/etc/lighttpd/lighttpd.conf</p>
<blockquote><p>[...]<br />
server.modules = (<br />
"mod_access",<br />
"mod_alias",<br />
"mod_accesslog",<br />
"mod_fastcgi", <br />
# "mod_rewrite",<br />
# "mod_redirect",<br />
# "mod_status",<br />
# "mod_evhost",<br />
# "mod_compress",<br />
# "mod_usertrack",<br />
# "mod_rrdtool",<br />
# "mod_webdav",<br />
# "mod_expire",<br />
# "mod_flv_streaming",<br />
# "mod_evasive"<br />
)<br />
[...]</p></blockquote>
<p>增加代码:</p>
<blockquote><p>"mod_fastcgi",</p></blockquote>
<p>注意逗号.</p>
<p>接着在文件最后增加</p>
<blockquote><p>fastcgi.server = ( ".php" =&gt; ((<br />
"bin-path" =&gt; "/usr/bin/php5-cgi",<br />
"socket" =&gt; "/tmp/php.socket"<br />
)))</p></blockquote>
<p>保存即可完成Lighttpd 与PHP的关联.</p>
<p>重新启动lighttpd</p>
<blockquote><p>/etc/init.d/lighttpd restart</p></blockquote>
<p><strong>2.2.3 测试PHP.</strong></p>
<p>我们使用iProber探针测试环境.</p>
<p>同样使用HyperVM控制面板"File Manager上传iProber.php到 /var/www</p>
<p><a href="http://soft.vpser.net/prober/iProber.zip" target="_blank">iProber探针下载</a> <a href="http://soft.vpser.net/prober/iProber.zip">http://soft.vpser.net/prober/iProber.zip</a></p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-14.png" target="_blank"><img class="alignnone size-full wp-image-268" title="debian-webserver-14" src="http://www.vpser.net/uploads/2009/04/debian-webserver-14.png" alt="debian-webserver-14" width="513" height="318" /></a> </p>
<p>然后我们打开 http://你的独立IP/iProber.php</p>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-15.png" target="_blank"><img class="alignnone size-full wp-image-269" title="debian-webserver-15" src="http://www.vpser.net/uploads/2009/04/debian-webserver-15.png" alt="debian-webserver-15" width="488" height="484" /></a> </p>
<p>看到该页面代表PHP运行成功..........</p>
<p><strong>2.3 让PHP支持MYSQL.</strong></p>
<p>很激动吧！PHP装好了吧....</p>
<p>不过突然发现探针上面</p>
<p>出现MYSQL不支持！！！！</p>
<p> <a href="http://www.vpser.net/uploads/2009/04/debian-webserver-16.png" target="_blank"><img class="alignnone size-full wp-image-270" title="debian-webserver-16" src="http://www.vpser.net/uploads/2009/04/debian-webserver-16.png" alt="debian-webserver-16" width="350" height="31" /></a></p>
<p> <a href="http://www.vpser.net/uploads/2009/04/debian-webserver-17.png" target="_blank"><img class="alignnone size-full wp-image-271" title="debian-webserver-17" src="http://www.vpser.net/uploads/2009/04/debian-webserver-17.png" alt="debian-webserver-17" width="514" height="71" /></a></p>
<p>啊！原来还有一步没有做呢！那好吧~让我们的php与mysql相处吧！</p>
<p>获得MySQL在PHP中的支持，我们可以安装php5 - MySQL的方案。这是一个很好的主意，需要安装一些其他php5模块，以及允许他们为您的应用程序。您可以搜索那些可用的php5模块使用这个命令：</p>
<blockquote><p>apt-cache search php5</p></blockquote>
<p><a href="http://www.vpser.net/uploads/2009/04/debian-webserver-18.png" target="_blank"><img class="alignnone size-full wp-image-272" title="debian-webserver-18" src="http://www.vpser.net/uploads/2009/04/debian-webserver-18.png" alt="debian-webserver-18" width="476" height="484" /></a></p>
<p>这时我们看到了php5-mysql这个模块，但是为了保证服务器对大部分程序的支援，我们还需要安装其他需要的模块，如php5-curl php5-gd php-pear等等。我们使用命令：</p>
<blockquote><p>apt-get install php-pear php5-curl php5-dev php5-gd php5-idn php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-suhosin php5-tidy php5-xmlrpc php5-xsl</p></blockquote>
<p><strong>注：</strong>php5-suhosin模块就是前面提到的安全防护系统，它有两种安装方式，这里是用模块安装的方法相当于给PHP5进行打补丁。后面我会提到用第三方扩展的形式进行安装的。</p>
<p>重启我们的Lighttpd</p>
<blockquote><p>/etc/init.d/lighttpd restart</p></blockquote>
<p>现在再打开探针地址，是不是连接成功了？</p>
<p><strong>3.0 安装Zend</strong></p>
<p>安装Zend，我们需要登录到Zend的官方网站下载，下载需要用户名，我们可以注册一个，当然这是免费的，然后下载对应版本，然后上传到服务器Root用户目录/root</p>
<p>安装过程如下：</p>
<blockquote><p>wget <a href="http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz">http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz</a><br />
tar -zxf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz<br />
cd ZendOptimizer-3.3.3-linux-glibc23-i386<br />
sh install.sh</p></blockquote>
<p>安装的时候会给你看相关说明，并且会让你同意其条款，这些我们不管，我们需要注意的是后面它会让你输入目前php.ini所在目录，这里我们输入/etc/php5/cgi，然后会问你是否使用Apache Web Server，因为我们选择了Lighttpd，所以这里我们选否，然后安装结束，系统会告诉你之前的php.ini已经备份为php.ini.bak，新的php.ini文件所在目录为/usr/local/Zend/etc/，以后如果要修改php的设置，就需要进入/usr/local/Zend/etc/这个目录修改php.ini。</p>
<p>然后输入：</p>
<blockquote><p>cd ..<br />
rm -rf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz ZendOptimizer-3.3.3-linux-glibc23-i386</p></blockquote>
<p>删除之前的安装文件</p>
<p><strong>4.0 安装suhosin</strong></p>
<p>前面我们说过suhosin有两种方法，上面那个是以补丁包的方式进行安装，这里我们将它以第三方扩展的形式进行安装。安装过程如下：</p>
<blockquote><p>wget <a href="http://download.suhosin.org/suhosin-0.9.27.tgz">http://download.suhosin.org/suhosin-0.9.27.tgz</a><br />
tar -zxf suhosin-0.9.27.tgz<br />
cd suhosin-0.9.27<br />
phpize<br />
./configure<br />
make&amp;&amp;make install<br />
cd ..<br />
rm -rf suhosin-0.9.27.tgz suhosin-0.9.27</p></blockquote>
<p>然后我们再在/usr/local/Zend/etc/php.ini文件中添加</p>
<blockquote><p>[Suhosin]<br />
extension=suhosin.so</p></blockquote>
<p>suhosin的默认配置已经足够满足大部分人的需求了，如果需要增强设置，可以在php.ini文件中添加相应的值。详情请登录<a href="http://www.hardened-php.net/suhosin/#using_suhosin">http://www.hardened-php.net/suhosin/#using_suhosin</a></p>
<p><strong>5.0 安装Ftp服务端软件</strong></p>
<p>作为服务器，必不可少需要安装FTP服务器端软件。Linux下有很多出色的Ftpd软件，我们这里选用vsftpd，短小精悍，足够满足我们的需求。使用命令：</p>
<blockquote><p>apt-get install vsftpd</p></blockquote>
<p>安装完成之后，默认的配置文件所在为/etc/vsftpd.conf</p>
<p>启动 vsftpd：</p>
<p>/etc/init.d/vsftpd start</p>
<p>以下命令建立FTP帐户及相应目录：</p>
<blockquote><p>useradd FTP帐户 -d /home/你要的目录名 -s /bin/nologin</p></blockquote>
<p>比如我要在 123目录建立一个 456用户，那命令应该是：</p>
<p>useradd 456 -d /home/123 -s /bin/nologin</p>
<p>-s /bin/nologin则表示禁止SSH登陆，去掉则可以使用SSH</p>
<p>使用“passwd 用户名”设定用户密码</p>
<blockquote><p>passwd 用户名</p></blockquote>
<p>会出现密码提示，输入密码即可</p>
<p><strong>6.0 安装phpmyadmin</strong></p>
<blockquote><p>apt-get install phpmyadmin</p></blockquote>
<p>安装好之后，如果出现在/usr/share/目录，就输入以下</p>
<blockquote><p>mv /usr/share/phpmyadmin /var/www/phpmyadmin</p></blockquote>
<p>移动个目录</p>
<p>安装成功后，可以直接登陆</p>
<p>http://你的独立IP/phpmyadmin</p>
<h2  class="related_post_title">相关文章：</h2><ul class="related_post"><li><a href="http://www.vpser.net/build/vps-nginx-mysql-php.html" title="VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化">VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化</a></li><li><a href="http://www.vpser.net/coupons/vpsyou-2011-august-coupons.html" title="VPSYOU 2011年8月全线VPS8折优惠码">VPSYOU 2011年8月全线VPS8折优惠码</a></li><li><a href="http://www.vpser.net/coupons/burstnet-2011-june-windows-linux-vps-coupons.html" title="BurstNet 2011年6月Windows和Linux VPS优惠码">BurstNet 2011年6月Windows和Linux VPS优惠码</a></li><li><a href="http://www.vpser.net/manage/linux-reset-mysql-root-password.html" title="Linux下重置MySQL root密码">Linux下重置MySQL root密码</a></li><li><a href="http://www.vpser.net/build/linode-install-openvpn.html" title="Linode VPS OpenVPN安装配置教程(基于Debian/Ubuntu)">Linode VPS OpenVPN安装配置教程(基于Debian/Ubuntu)</a></li><li><a href="http://www.vpser.net/manage/mysql-import-export.html" title="Linux VPS/服务器上轻松导入、导出MySQL数据库">Linux VPS/服务器上轻松导入、导出MySQL数据库</a></li><li><a href="http://www.vpser.net/manage/delete-mysql-mysql-bin-0000-logs.html" title="如何关闭MySQL日志，删除mysql-bin.0000*日志文件">如何关闭MySQL日志，删除mysql-bin.0000*日志文件</a></li><li><a href="http://www.vpser.net/build/lnmp-0-5.html" title="LNMP一键安装包 0.5 正式发布">LNMP一键安装包 0.5 正式发布</a></li><li><a href="http://www.vpser.net/coupons/buyvm-15-fremont-he-net-128mb-openvz-vps.html" title="BuyVM – $15/年 Fremont He.net 128MB OpenVZ VPS有货啦">BuyVM – $15/年 Fremont He.net 128MB OpenVZ VPS有货啦</a></li><li><a href="http://www.vpser.net/domain/namecheap-2010-september-coupons.html" title="NameCheap 2010年9月优惠码">NameCheap 2010年9月优惠码</a></li></ul><hr />
<p><small>© VPSer for <a href="http://www.vpser.net">VPS侦探</a>, 2009. |
<a href="http://www.vpser.net/build/debian-vps-web-server.html">Permalink</a> |
<a href="http://www.vpser.net/build/debian-vps-web-server.html#comments">7 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.vpser.net/build/debian-vps-web-server.html&title=Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境">del.icio.us</a>
<br/>
Post tags: <a href="http://www.vpser.net/tag/debian" rel="tag">Debian</a>, <a href="http://www.vpser.net/tag/lighttpd" rel="tag">Lighttpd</a>, <a href="http://www.vpser.net/tag/mysql" rel="tag">MySQL</a>, <a href="http://www.vpser.net/tag/vps" rel="tag">VPS</a>, <a href="http://www.vpser.net/tag/web" rel="tag">Web</a><br/>
<br/>
<img src="http://www.vpser.net/images/tuijian.gif"> <a href="http://www.vpser.net/usa-vps/">美国VPS推荐</a>  | <a href="http://shop63846532.taobao.com/">军哥代购 - 提供美国及海外VPS/VPN/域名代购，美元/欧元代付</a> QQ：503228080
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vpser.net/build/debian-vps-web-server.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>VPS主机上MySQL数据库的优化</title>
		<link>http://www.vpser.net/opt/vps-mysql-opt.html</link>
		<comments>http://www.vpser.net/opt/vps-mysql-opt.html#comments</comments>
		<pubDate>Sat, 18 Apr 2009 11:31:41 +0000</pubDate>
		<dc:creator>VPSer</dc:creator>
				<category><![CDATA[VPS优化]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[VP主机]]></category>
		<category><![CDATA[数据库优化]]></category>

		<guid isPermaLink="false">http://www.vpser.net/?p=224</guid>
		<description><![CDATA[概述：在linux vps主机上配置mysql数据库，由于默认使用yum安装的数据库启动了InnoDB引擎，同时其/etc/my.cnf配置都我们的vps主机不是很适合，本文详细讲解如何配置适合自己vps主机的mysql配置文件 目的:优化vps主机上的mysql数据库，使之更合适vps主机这样的环境 query_cache_size = 268435456 query_cache_type=1 query_cache_limit=1048576 查看mysql-server静态参数值命令 mysql&#62;show variables; 或者mysqladmin -uroot variables mysql服务器的参数很多，如果需要了解某个参数的详细定义，可以使用mysqld –verbose –help &#124; more 查看mysql-server动态状态信息命令 mysql&#62;show status; 或者mysqladmin -uroot status 其中show status分为show [session&#124;global]status;可以根据需要加上参数“session”或者”global”来显示session级（当前统计）的统计结果和global级（自数据库上次启动至今）的统计结果，如果不写，默认为”session” 1、查看和修改默认的存储引擎，关闭不需要的存储引擎 在我们使用vps主机过程中，很多用户只使用MyISAM一个引擎，关闭那么没有使用的InnoDB MEMORY等其他引擎 查看当前系统有哪些引擎 mysql&#62;SHOW ENGINES \G 或者第二种方法 mysql&#62;SHOW VARIABLES LIKE 'have%'; 查看默认引擎 mysql&#62; show variables like 'table_type'; +---------------+--------+ &#124; Variable_name &#124; Value &#124; +---------------+--------+ &#124; table_type [...]]]></description>
			<content:encoded><![CDATA[<p><strong>概述：</strong>在linux vps主机上配置mysql数据库，由于默认使用yum安装的数据库启动了InnoDB引擎，同时其/etc/my.cnf配置都我们的vps主机不是很适合，本文详细讲解如何配置适合自己vps主机的mysql配置文件</p>
<p><strong>目的:</strong>优化vps主机上的mysql数据库，使之更合适vps主机这样的环境</p>
<div class="wp_syntax" style="padding-bottom: 0px;">
<div class="code">
<pre class="bash" style="font-family: monospace;">query_cache_size = <span style="color: #000000;">268435456</span>
<span style="color: #007800;">query_cache_type</span>=<span style="color: #000000;">1</span>
<span style="color: #007800;">query_cache_limit</span>=<span style="color: #000000;">1048576</span></pre>
</div>
</div>
<p><strong>查看mysql-server静态参数值命令</strong><br />
mysql&gt;show variables;<span id="more-224"></span><br />
或者mysqladmin -uroot variables<br />
mysql服务器的参数很多，如果需要了解某个参数的详细定义，可以使用mysqld –verbose –help | more<br />
<strong>查看mysql-server动态状态信息命令</strong></p>
<p>mysql&gt;show status;</p>
<p>或者mysqladmin -uroot status<br />
其中show status分为show [session|global]status;可以根据需要加上参数“session”或者”global”来显示session级（当前统计）的统计结果和global级（自数据库上次启动至今）的统计结果，如果不写，默认为”session”</p>
<p><strong>1、查看和修改默认的存储引擎，关闭不需要的存储引擎</strong><br />
在我们使用vps主机过程中，很多用户只使用MyISAM一个引擎，关闭那么没有使用的InnoDB MEMORY等其他引擎<br />
查看当前系统有哪些引擎</p>
<div class="wp_syntax" style="padding-bottom: 0px;">
<div class="code">
<pre class="bash" style="font-family: monospace;">mysql<span style="font-weight: bold; color: #000000;">&gt;</span>SHOW ENGINES \G
或者第二种方法
mysql<span style="font-weight: bold; color: #000000;">&gt;</span>SHOW VARIABLES LIKE <span style="color: #ff0000;">'have%'</span>;</pre>
</div>
</div>
<p>查看默认引擎</p>
<div class="wp_syntax" style="padding-bottom: 0px;">
<div class="code">
<pre class="bash" style="font-family: monospace;">mysql<span style="font-weight: bold; color: #000000;">&gt;</span> show variables like <span style="color: #ff0000;">'table_type'</span>;
+---------------+--------+
<span style="font-weight: bold; color: #000000;">|</span> Variable_name <span style="font-weight: bold; color: #000000;">|</span> Value  <span style="font-weight: bold; color: #000000;">|</span>
+---------------+--------+
<span style="font-weight: bold; color: #000000;">|</span> table_type    <span style="font-weight: bold; color: #000000;">|</span> MyISAM <span style="font-weight: bold; color: #000000;">|</span>
+---------------+--------+
<span style="color: #000000;">1</span> row <span style="font-weight: bold; color: #000000;">in</span> <span style="font-weight: bold; color: #000000;">set</span> <span style="font-weight: bold; color: #7a0874;">(</span><span style="color: #000000;">0.00</span> sec<span style="font-weight: bold; color: #7a0874;">)</span>
或者
mysql<span style="font-weight: bold; color: #000000;">&gt;</span> show variables like <span style="color: #ff0000;">'storage_engine'</span>;
+----------------+--------+
<span style="font-weight: bold; color: #000000;">|</span> Variable_name  <span style="font-weight: bold; color: #000000;">|</span> Value  <span style="font-weight: bold; color: #000000;">|</span>
+----------------+--------+
<span style="font-weight: bold; color: #000000;">|</span> storage_engine <span style="font-weight: bold; color: #000000;">|</span> MyISAM <span style="font-weight: bold; color: #000000;">|</span>
+----------------+--------+
<span style="color: #000000;">1</span> row <span style="font-weight: bold; color: #000000;">in</span> <span style="font-weight: bold; color: #000000;">set</span> <span style="font-weight: bold; color: #7a0874;">(</span><span style="color: #000000;">0.00</span> sec<span style="font-weight: bold; color: #7a0874;">)</span></pre>
</div>
</div>
<p>mysql默认的存储引擎是MyISAM,修改默认的存储引擎可以修改/etc/my.cnf参数文件，在[mysqld]字段里面增加default-storage-engine=innodb，这里假设设置默认为innodb，根据自己的需要进行设置,关闭不需要的存储引擎，可以修改/etc/my.cnf参数文件，在[mysqld]字段里面增加–skip-innodb。<br />
<strong>2、调节key_buffer_size大小</strong></p>
<div class="wp_syntax" style="padding-bottom: 15px;">
<div class="code">
<pre class="bash" style="font-family: monospace;">mysql<span style="font-weight: bold; color: #000000;">&gt;</span> show variables like <span style="color: #ff0000;">'key_buffer_size'</span>;
+-----------------+-----------+
<span style="font-weight: bold; color: #000000;">|</span> Variable_name   <span style="font-weight: bold; color: #000000;">|</span> Value     <span style="font-weight: bold; color: #000000;">|</span>
+-----------------+-----------+
<span style="font-weight: bold; color: #000000;">|</span> key_buffer_size <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">402653184</span> <span style="font-weight: bold; color: #000000;">|</span>
+-----------------+-----------+
<span style="color: #000000;">1</span> row <span style="font-weight: bold; color: #000000;">in</span> <span style="font-weight: bold; color: #000000;">set</span> <span style="font-weight: bold; color: #7a0874;">(</span><span style="color: #000000;">0.00</span> sec<span style="font-weight: bold; color: #7a0874;">)</span>
 
mysql<span style="font-weight: bold; color: #000000;">&amp;</span>gt;
从上面可以看到,key_buffer_size为：384M,可以修改<span style="font-weight: bold; color: #000000;">/</span>etc<span style="font-weight: bold; color: #000000;">/</span>my.cnf参数文件，在<span style="font-weight: bold; color: #7a0874;">[</span>mysqld<span style="font-weight: bold; color: #7a0874;">]</span>字段里面增加key_buffer_size = 384M，当然也可以使用mysql<span style="font-weight: bold; color: #000000;">&gt;</span><span style="font-weight: bold; color: #000000;">set</span> grobal <span style="color: #007800;">key_buffer_size</span>=512M修改。
此参数是用来<span style="font-weight: bold; color: #000000;">&lt;</span>strong<span style="font-weight: bold; color: #000000;">&gt;</span>设置索引块<span style="font-weight: bold; color: #000000;">&lt;/</span>strong<span style="font-weight: bold; color: #000000;">&gt;</span>（Index Blocks<span style="font-weight: bold; color: #7a0874;">)</span>缓存的大小，它被所有的线程共享，只适合MyISAM存储引擎。</pre>
</div>
</div>
<p><strong>3、调节table_cache设置</strong><br />
这个参数表示数据库用户打开表的缓存数量，每个连接进来，都会至少打开一个表缓存，如此，table_cache与max_connections有关，<br />
查看当前的table_cache值</p>
<div class="wp_syntax" style="padding-bottom: 0px;">
<div class="code">
<pre class="bash" style="font-family: monospace;">mysql<span style="font-weight: bold; color: #000000;">&gt;</span> show variables like <span style="color: #ff0000;">'table_cache'</span>;
+---------------+-------+
<span style="font-weight: bold; color: #000000;">|</span> Variable_name <span style="font-weight: bold; color: #000000;">|</span> Value <span style="font-weight: bold; color: #000000;">|</span>
+---------------+-------+
<span style="font-weight: bold; color: #000000;">|</span> table_cache   <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">4096</span>  <span style="font-weight: bold; color: #000000;">|</span>
+---------------+-------+
<span style="color: #000000;">1</span> row <span style="font-weight: bold; color: #000000;">in</span> <span style="font-weight: bold; color: #000000;">set</span> <span style="font-weight: bold; color: #7a0874;">(</span><span style="color: #000000;">0.00</span> sec<span style="font-weight: bold; color: #7a0874;">)</span></pre>
</div>
</div>
<p>从上面可以看到,table_cache为：4096,可以修改/etc/my.cnf参数文件，在[mysqld]字段里面增加table_cachee = 4096</p>
<p><strong>4、调节query_cache设置</strong></p>
<p>Query Cache 在提高数据库性能方面具有非常重要的作用，其设定也非常简单，仅需要在配置文件写入两行： query_cache_type 和 query_cache _size，而且 MySQL 的 query cache 非常快！而且一旦命中，就直接发送给客户端，节约大量的 CPU 时间。</p>
<p>当然，非 SELECT 语句对缓冲是有影响的，它们可能使缓冲中的数据过期。一个 UPDATE 语句引起的部分表修改，将导致对该表所有的缓冲数据失效，这是 MySQL 为了平衡性能而没有采取的措施。因为，如果每次 UPDATE 需要检查修改的数据，然后撤出部分缓冲将导致代码的复杂度增加。</p>
<p>query_cache_type ：0 代表不使用缓冲， 1 代表使用缓冲，2 代表根据需要使用。</p>
<p>设置 1 代表缓冲永远有效，如果不需要缓冲，就需要使用如下语句：</p>
<p>SELECT SQL_NO_CACHE * FROM my_table WHERE …</p>
<p>如果设置为 2 ，需要开启缓冲，可以用如下语句：</p>
<p>SELECT SQL_CACHE * FROM my_table WHERE …</p>
<p>用 SHOW STATUS 可以查看缓冲的情况：</p>
<div class="wp_syntax" style="padding-bottom: 0px;">
<div class="code">
<pre class="bash" style="font-family: monospace;">mysql<span style="font-weight: bold; color: #000000;">&gt;</span> show status like <span style="color: #ff0000;">'Qca%'</span>;
+-------------------------+----------+
<span style="font-weight: bold; color: #000000;">|</span> Variable_name <span style="font-weight: bold; color: #000000;">|</span> Value <span style="font-weight: bold; color: #000000;">|</span>
+-------------------------+----------+
<span style="font-weight: bold; color: #000000;">|</span> Qcache_queries_in_cache <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">8</span> <span style="font-weight: bold; color: #000000;">|</span>
<span style="font-weight: bold; color: #000000;">|</span> Qcache_inserts <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">545875</span> <span style="font-weight: bold; color: #000000;">|</span>
<span style="font-weight: bold; color: #000000;">|</span> Qcache_hits <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">83951</span> <span style="font-weight: bold; color: #000000;">|</span>
<span style="font-weight: bold; color: #000000;">|</span> Qcache_lowmem_prunes <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">0</span> <span style="font-weight: bold; color: #000000;">|</span>
<span style="font-weight: bold; color: #000000;">|</span> Qcache_not_cached <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">2343256</span> <span style="font-weight: bold; color: #000000;">|</span>
<span style="font-weight: bold; color: #000000;">|</span> Qcache_free_memory <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">33508248</span> <span style="font-weight: bold; color: #000000;">|</span>
<span style="font-weight: bold; color: #000000;">|</span> Qcache_free_blocks <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">1</span> <span style="font-weight: bold; color: #000000;">|</span>
<span style="font-weight: bold; color: #000000;">|</span> Qcache_total_blocks <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">18</span> <span style="font-weight: bold; color: #000000;">|</span>
+-------------------------+----------+
<span style="color: #000000;">8</span> rows <span style="font-weight: bold; color: #000000;">in</span> <span style="font-weight: bold; color: #000000;">set</span> <span style="font-weight: bold; color: #7a0874;">(</span><span style="color: #000000;">0.00</span> sec<span style="font-weight: bold; color: #7a0874;">)</span></pre>
</div>
</div>
<p>如果需要计算命中率，需要知道服务器执行了多少 SELECT 语句：</p>
<div class="wp_syntax" style="padding-bottom: 0px;">
<div class="code">
<pre class="bash" style="font-family: monospace;">mysql<span style="font-weight: bold; color: #000000;">&gt;</span> show status like <span style="color: #ff0000;">'Com_sel%'</span>;
+---------------+---------+
<span style="font-weight: bold; color: #000000;">|</span> Variable_name <span style="font-weight: bold; color: #000000;">|</span> Value <span style="font-weight: bold; color: #000000;">|</span>
+---------------+---------+
<span style="font-weight: bold; color: #000000;">|</span> Com_select <span style="font-weight: bold; color: #000000;">|</span> <span style="color: #000000;">2889628</span> <span style="font-weight: bold; color: #000000;">|</span>
+---------------+---------+
<span style="color: #000000;">1</span> row <span style="font-weight: bold; color: #000000;">in</span> <span style="font-weight: bold; color: #000000;">set</span> <span style="font-weight: bold; color: #7a0874;">(</span><span style="color: #000000;">0.01</span> sec<span style="font-weight: bold; color: #7a0874;">)</span></pre>
</div>
</div>
<p>在本例中， MySQL 命中了 2,889,628 条查询中的 83,951 条，而且 INSERT 语句只有 545,875 条。因此，它们两者的和和280万的总查询相比有很大差距，因此，我们知道本例使用的缓冲类型是 2 。</p>
<p>而在类型是 1 的例子中， Qcache_hits 的数值会远远大于 Com_select 。 Qcache_not_cached是可以记录DML语句的数量的</p>
<h2  class="related_post_title">相关文章：</h2><ul class="related_post"><li><a href="http://www.vpser.net/manage/linux-reset-mysql-root-password.html" title="Linux下重置MySQL root密码">Linux下重置MySQL root密码</a></li><li><a href="http://www.vpser.net/manage/mysql-import-export.html" title="Linux VPS/服务器上轻松导入、导出MySQL数据库">Linux VPS/服务器上轻松导入、导出MySQL数据库</a></li><li><a href="http://www.vpser.net/manage/delete-mysql-mysql-bin-0000-logs.html" title="如何关闭MySQL日志，删除mysql-bin.0000*日志文件">如何关闭MySQL日志，删除mysql-bin.0000*日志文件</a></li><li><a href="http://www.vpser.net/vps-cp/kloxo-dont-support-mysql-gd.html" title="安装完kloxo后不支持Mysql,GD问题的解决方法">安装完kloxo后不支持Mysql,GD问题的解决方法</a></li><li><a href="http://www.vpser.net/build/debian-vps-web-server.html" title="Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境">Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境</a></li><li><a href="http://www.vpser.net/build/vps-nginx-mysql-php.html" title="VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化">VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化</a></li></ul><hr />
<p><small>© VPSer for <a href="http://www.vpser.net">VPS侦探</a>, 2009. |
<a href="http://www.vpser.net/opt/vps-mysql-opt.html">Permalink</a> |
<a href="http://www.vpser.net/opt/vps-mysql-opt.html#comments">6 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.vpser.net/opt/vps-mysql-opt.html&title=VPS主机上MySQL数据库的优化">del.icio.us</a>
<br/>
Post tags: <a href="http://www.vpser.net/tag/mysql" rel="tag">MySQL</a>, <a href="http://www.vpser.net/tag/vp%e4%b8%bb%e6%9c%ba" rel="tag">VP主机</a>, <a href="http://www.vpser.net/tag/%e6%95%b0%e6%8d%ae%e5%ba%93%e4%bc%98%e5%8c%96" rel="tag">数据库优化</a><br/>
<br/>
<img src="http://www.vpser.net/images/tuijian.gif"> <a href="http://www.vpser.net/usa-vps/">美国VPS推荐</a>  | <a href="http://shop63846532.taobao.com/">军哥代购 - 提供美国及海外VPS/VPN/域名代购，美元/欧元代付</a> QQ：503228080
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vpser.net/opt/vps-mysql-opt.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化</title>
		<link>http://www.vpser.net/build/vps-nginx-mysql-php.html</link>
		<comments>http://www.vpser.net/build/vps-nginx-mysql-php.html#comments</comments>
		<pubDate>Wed, 25 Mar 2009 06:38:34 +0000</pubDate>
		<dc:creator>VPSer</dc:creator>
				<category><![CDATA[服务器环境搭建]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[VPS]]></category>
		<category><![CDATA[vsftpd]]></category>
		<category><![CDATA[优化]]></category>
		<category><![CDATA[初始化]]></category>

		<guid isPermaLink="false">http://www.vpser.net/?p=85</guid>
		<description><![CDATA[VPS购买来了，不能就这么放在，对吧。下面给大家说一下VPS买来之后的初始化操作，及Nginx+MySQL+PHP+PHPMyAdmin+eAcelerator+vsftpd这些软件的编译安装。 一、登录VPS 登录的方式很多，如果是Linux直接ssh就可以。 下面以Windows下putty为例： 填写上IP或域名，再写个名字，save ，然后Open 二、安装LNMP(基于CentOS) 安装Nginx+MySQL+PHP+PHPMyAdmin+eAcelerator+vsftpd使用Licess的LNMP。 有些VPS默认是安装Apahche的，如果安装了，请先执行：yum -y remove httpd 下面是按照的过程使用的命令，及相关注释(注释用 //，红色加粗为所使用的命令)，LNMP已更新，新版请到http://blog.licess.cn/lnmp/ 看新教程。 Using username "root". root@67.215.242.196's password: [root@vpser ~]#cd /usr/local/src [root@vpser src]#ls [root@vpser src]#wget http://licess.googlecode.com/files/LNMP.zip      //下载LNMP文件 --11:29:51--  http://licess.googlecode.com/files/LNMP.zip Resolving licess.googlecode.com... 209.85.173.82 Connecting to licess.googlecode.com&#124;209.85.173.82&#124;:80... connected. HTTP request sent, awaiting response... 200 OK Length: 11261 (11K) [application/x-zip] Saving to: `LNMP.zip' 100%[=======================================&#62;] 11,261      --.-K/s   [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.vpser.net/uploads/2009/03/7.jpg"></a>VPS购买来了，不能就这么放在，对吧。下面给大家说一下VPS买来之后的初始化操作，及Nginx+MySQL+PHP+PHPMyAdmin+eAcelerator+vsftpd这些软件的编译安装。</p>
<p>一、登录VPS</p>
<p>登录的方式很多，如果是Linux直接ssh就可以。</p>
<p>下面以Windows下putty为例：</p>
<p><a href="http://www.vpser.net/uploads/2009/03/putty.jpg" target="_blank"><img class="alignnone size-full wp-image-86" title="putty" src="http://www.vpser.net/uploads/2009/03/putty.jpg" alt="putty" width="452" height="437" /></a><span id="more-85"></span></p>
<p>填写上IP或域名，再写个名字，save ，然后Open</p>
<p><a href="http://www.vpser.net/uploads/2009/03/1.jpg" target="_blank"><img class="alignnone size-medium wp-image-87" title="1" src="http://www.vpser.net/uploads/2009/03/1-300x188.jpg" alt="1" width="300" height="188" /></a></p>
<p>二、安装LNMP(基于CentOS)</p>
<p>安装Nginx+MySQL+PHP+PHPMyAdmin+eAcelerator+vsftpd使用<a href="http://blog.licess.cn" target="_blank">Licess</a>的<a href="http://blog.licess.cn/lnmp" target="_blank">LNMP</a>。</p>
<p>有些VPS默认是安装Apahche的，如果安装了，请先执行：yum -y remove httpd</p>
<p>下面是按照的过程使用的命令，及相关注释(注释用 //，红色加粗为所使用的命令)，LNMP已更新，新版请到<a href="http://blog.licess.cn/lnmp/">http://blog.licess.cn/lnmp/</a> 看新教程。</p>
<p>Using username "root".<br />
<a href="mailto:root@67.215.242.196's">root@67.215.242.196's</a> password:<br />
[root@vpser ~]#<strong><span style="color: #ff0000;">cd /usr/local/src</span><br />
</strong>[root@vpser src]#<strong><span style="color: #ff0000;">ls</span></strong><br />
[root@vpser src]#<strong><span style="color: #ff0000;">wget </span></strong><a href="http://licess.googlecode.com/files/LNMP.zip"><strong><span style="color: #ff0000;">http://licess.googlecode.com/files/LNMP.zip</span></strong></a>      //下载LNMP文件<br />
--11:29:51--  <a href="http://licess.googlecode.com/files/LNMP.zip">http://licess.googlecode.com/files/LNMP.zip</a><br />
Resolving licess.googlecode.com... 209.85.173.82<br />
Connecting to licess.googlecode.com|209.85.173.82|:80... connected.<br />
HTTP request sent, awaiting response... 200 OK<br />
Length: 11261 (11K) [application/x-zip]<br />
Saving to: `LNMP.zip'</p>
<p>100%[=======================================&gt;] 11,261      --.-K/s   in 0.1s</p>
<p>11:29:52 (111 KB/s) - `LNMP.zip' saved [11261/11261]</p>
<p>[root@vpser src]#<span style="color: #ff0000;"><strong>unzip LNMP.zip        </strong></span>//解压LNMP压缩包<br />
Archive:  LNMP.zip<br />
   creating: LNMP/<br />
   creating: LNMP/conf/<br />
  inflating: LNMP/conf/fcgi.conf<br />
  inflating: LNMP/conf/nginx-load.conf<br />
  inflating: LNMP/conf/nginx-proxy.conf<br />
  inflating: LNMP/conf/nginx.conf<br />
  inflating: LNMP/conf/php-fpm.conf<br />
  inflating: LNMP/down.sh<br />
  inflating: LNMP/install.sh<br />
  inflating: LNMP/opt.sh<br />
  inflating: LNMP/readme.txt<br />
  inflating: LNMP/startup.sh<br />
[root@vpser src]#<strong><span style="color: #ff0000;">cd LNMP</span></strong><br />
[root@vpser LNMP]#<span style="color: #ff0000;"><strong>ls</strong><br />
</span>conf  down.sh  install.sh  opt.sh  readme.txt  startup.sh<br />
[root@vpser LNMP]#<strong><span style="color: #ff0000;">chmod +x install.sh down.sh</span></strong>        //为install.sh和down.sh添加执行权限<br />
[root@vpser LNMP]#<span style="color: #ff0000;"><strong>./down.sh</strong><span style="color: #000000;">                                                   //下载安装所需的源代码文件</span></span><br />
=========================================================================<br />
LNMP v0.0.1 for VPS  Written by Licess<br />
=========================================================================</p>
<p>For more information please visit <a href="http://blog.licess.cn/lnmp/">http://blog.licess.cn/lnmp/</a></p>
<p>start download LNMP package<br />
...............................省略下载过程</p>
<p>download package finished!</p>
<p>=========================================================================<br />
[root@vpser LNMP]#<strong><span style="color: #ff0000;">clear</span></strong><br />
[root@vpser LNMP]#<strong><span style="color: #ff0000;">ls<br />
</span></strong>conf                          mysql-5.0.22.tar.gz<br />
down.sh                       nginx-0.7.19.tar.gz<br />
eaccelerator-0.9.5.3.tar.bz2  opt.sh<br />
install.sh                    pcre-7.7.tar.gz<br />
libiconv-1.12.tar.gz          php-5.2.6-fpm-0.5.9.diff.gz<br />
libmcrypt-2.5.8.tar.gz        php-5.2.6.tar.gz<br />
mcrypt-2.6.7.tar.gz           phpMyAdmin-3.1.1-all-languages.tar.gz<br />
memcache-2.2.3.tgz            readme.txt<br />
mhash-0.9.9.tar.gz            startup.sh<br />
[root@vpser LNMP#<strong><span style="color: #ff0000;">]./install.sh      </span></strong>  //开始安装<br />
=========================================================================<br />
LNMP v0.0.1 for VPS  Written by Licess<br />
=========================================================================<br />
A tool to auto-compile &amp; install Nginx+MySQL+PHP on Linux<br />
For more information please visit <a href="http://blog.licess.cn/lnmp/">http://blog.licess.cn/lnmp/</a><br />
The path of some dirs:<br />
mysql dir:   /usr/local/mysql<br />
php dir:     /usr/local/php<br />
nginx dir:   /usr/local/nginx<br />
web dir      /web/www</p>
<p>=========================================================================</p>
<p><a href="http://www.vpser.net/uploads/2009/03/3.jpg" target="_blank"><img class="alignnone size-full wp-image-89" title="3" src="http://www.vpser.net/uploads/2009/03/3.jpg" alt="3" width="659" height="303" /></a></p>
<p>在此步中输入你要绑定的域名，例如：diavps.vpser.net  ,回车确认。<br />
Please input domain:<br />
(Default domain: <a href="http://www.lnmp.org):diavps.vpser.net">www.lnmp.org):diavps.vpser.net</a><br />
===========================<br />
domain=diavps.vpser.net<br />
===========================</p>
<p>Press any key to start...                                     \\再次按任意键确认，开始安装<br />
Loading "fastestmirror" plugin<br />
......................................</p>
<p>开始安装........</p>
<p><a href="http://www.vpser.net/uploads/2009/03/4.jpg" target="_blank"><img class="alignnone size-full wp-image-88" title="4" src="http://www.vpser.net/uploads/2009/03/4.jpg" alt="4" width="660" height="410" /></a></p>
<p>PS：屏幕疯狂的滚动.......欣赏一下</p>
<p><a href="http://www.vpser.net/uploads/2009/03/5.jpg" target="_blank"><img class="alignnone size-full wp-image-90" title="5" src="http://www.vpser.net/uploads/2009/03/5.jpg" alt="5" width="666" height="419" /></a></p>
<p>经过漫长的等待(时间不确定，根据实际情况，我的是半个多小时)，终于安装完了。</p>
<p><a href="http://www.vpser.net/uploads/2009/03/6.jpg" target="_blank"><img class="alignnone size-full wp-image-91" title="6" src="http://www.vpser.net/uploads/2009/03/6.jpg" alt="6" width="659" height="417" /></a></p>
<p>下面看一下PHPInfo</p>
<p><a href="http://www.vpser.net/uploads/2009/03/7.jpg" target="_blank"><img class="alignnone size-medium wp-image-92" title="7" src="http://www.vpser.net/uploads/2009/03/7-300x195.jpg" alt="7" width="300" height="195" /></a></p>
<p>PHPMyAdmin:</p>
<p><a href="http://www.vpser.net/uploads/2009/03/8.jpg" target="_blank"><img class="alignnone size-full wp-image-93" title="8" src="http://www.vpser.net/uploads/2009/03/8.jpg" alt="8" width="509" height="275" /></a></p>
<p>程序安装路径：<br />
MySQL :   /usr/local/mysql<br />
PHP :     /usr/local/php<br />
Nginx :   /usr/local/nginx<br />
PHPMyAdmin /web/www/phpmyadmin<br />
Web目录    /web/www</p>
<p>MySQL  用户：root  密码：root</p>
<p>通过下面这几个链接查看phpinfo和管理MySQL<br />
phpinfo    <a href="http://ip/phpinfo.php">http://ip/phpinfo.php</a><br />
phpMyAdmin <a href="http://ip/phpmyadmin">http://ip/phpmyadmin</a></p>
<p>让Nginx开机后手动执行 /root/run.sh 后Nginx会运行 ，开机自动运行可以运行 LNMP目录下面的 startup.sh 文件即可。</p>
<p>opt.sh 为优化文件，如果内存小于128MB可以通过执行 ./opt.sh 添加swap分区，并修改时区为东8区。注：并不一定在所有的VPS上都可以添加swap分区，swvps不可以，其他没有测试。</p>
<p>安装完后，请立即修改您的MySQL的root密码，使用命令cd /usr/local/mysql/bin</p>
<p>再执行：./mysqladmin -u root -p password mypasswd          //mypasswd为自己的密码</p>
<p>输入这个命令后，需要输入root的原密码，然后root的密码将改为mypasswd。<br />
把命令里的root改为你的用户名，你就可以改你自己的密码了。</p>
<p>进入phpmyadmin目录/web/www/phpmyadmin  将 config.default.php 修改为config.inc.php</p>
<p>修改这个文件的 $cfg['Servers'][$i]['auth_type'] = 'http';</p>
<p>                                $cfg['blowfish_secret'] = 'VPSER';    //VPSER为任意字符</p>
<p>保存，然后就可以登录了。</p>
<p><span style="color: #ff0000;"><strong>安装vsftp：</strong></span><br />
下载vsftpd-for-LNMP.zip：执行 wget <a href="http://blog.licess.cn/uploads/200903/vsftpd-for-LNMP.zip"><span style="color: #ff0000;">http://blog.licess.cn/uploads/200903/vsftpd-for-LNMP.zip</span></a></p>
<p>unzip vsftpd-for-LNMP.zip</p>
<p>cd vsftpd for LNMP</p>
<p>./installvsftpd.sh</p>
<p>安装完毕后即可使用你的SSH的帐号和密码登录，也可以修改/etc/vsftpd.chroot限制用户在家目录里。默认添加了adminftp用户，但是没有设置密码，可以执行passwd adminftp 来设置密码，或者userdel admintpd 删除用户。</p>
<p>执行 adduser -d /web/www/user1 -s /sbin/nologin user1  来添加一个不能SSH登录的FTP帐号，家目录为/web/www/user1 但是没有限制，添加限制，请修改/etc/vsftpd.chroot 添加要限制的用户。</p>
<p>更详细的关于LNMP的可以看：<a href="http://blog.licess.cn/lnmp/">http://blog.licess.cn/lnmp/</a></p>
<p>可能在安装过程中遇到什么问题可以在下面留言。</p>
<h2  class="related_post_title">相关文章：</h2><ul class="related_post"><li><a href="http://www.vpser.net/manage/path_info-securit-bug.html" title="再提供一种解决Nginx文件类型错误解析漏洞的方法">再提供一种解决Nginx文件类型错误解析漏洞的方法</a></li><li><a href="http://www.vpser.net/build/ioncube-howto.html" title="Linux VPS Nginx+PHP环境下ionCube安装教程">Linux VPS Nginx+PHP环境下ionCube安装教程</a></li><li><a href="http://www.vpser.net/build/debian-vps-web-server.html" title="Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境">Debian VPS 安装安装(Lighttpd+MySQL+Zend+vsftpd+PHPMyAdmin)Web环境</a></li><li><a href="http://www.vpser.net/coupons/vpsyou-2011-august-coupons.html" title="VPSYOU 2011年8月全线VPS8折优惠码">VPSYOU 2011年8月全线VPS8折优惠码</a></li><li><a href="http://www.vpser.net/build/nginx-htpasswd.html" title="LNMP下为Nginx目录设置访问验证的用户名密码">LNMP下为Nginx目录设置访问验证的用户名密码</a></li><li><a href="http://www.vpser.net/coupons/burstnet-2011-june-windows-linux-vps-coupons.html" title="BurstNet 2011年6月Windows和Linux VPS优惠码">BurstNet 2011年6月Windows和Linux VPS优惠码</a></li><li><a href="http://www.vpser.net/security/lnmp-remove-nginx-php-execute.html" title="lnmp去掉nginx上传目录的PHP执行权限">lnmp去掉nginx上传目录的PHP执行权限</a></li><li><a href="http://www.vpser.net/security/lnmp-php-pathinfo.html" title="请各位lnmp用户检查php pathinfo设置！重要！">请各位lnmp用户检查php pathinfo设置！重要！</a></li><li><a href="http://www.vpser.net/manage/linux-reset-mysql-root-password.html" title="Linux下重置MySQL root密码">Linux下重置MySQL root密码</a></li><li><a href="http://www.vpser.net/manage/lnmp-upgrade-php-script.html" title="LNMP一键安装包 PHP自动升级脚本">LNMP一键安装包 PHP自动升级脚本</a></li></ul><hr />
<p><small>© VPSer for <a href="http://www.vpser.net">VPS侦探</a>, 2009. |
<a href="http://www.vpser.net/build/vps-nginx-mysql-php.html">Permalink</a> |
<a href="http://www.vpser.net/build/vps-nginx-mysql-php.html#comments">23 comments</a> |
Add to
<a href="http://del.icio.us/post?url=http://www.vpser.net/build/vps-nginx-mysql-php.html&title=VPS初始化及Nginx+MySQL+PHP/PHPMyAdmin安装优化">del.icio.us</a>
<br/>
Post tags: <a href="http://www.vpser.net/tag/mysql" rel="tag">MySQL</a>, <a href="http://www.vpser.net/tag/nginx" rel="tag">Nginx</a>, <a href="http://www.vpser.net/tag/php" rel="tag">PHP</a>, <a href="http://www.vpser.net/tag/vps" rel="tag">VPS</a>, <a href="http://www.vpser.net/tag/vsftpd" rel="tag">vsftpd</a>, <a href="http://www.vpser.net/tag/%e4%bc%98%e5%8c%96" rel="tag">优化</a>, <a href="http://www.vpser.net/tag/%e5%88%9d%e5%a7%8b%e5%8c%96" rel="tag">初始化</a><br/>
<br/>
<img src="http://www.vpser.net/images/tuijian.gif"> <a href="http://www.vpser.net/usa-vps/">美国VPS推荐</a>  | <a href="http://shop63846532.taobao.com/">军哥代购 - 提供美国及海外VPS/VPN/域名代购，美元/欧元代付</a> QQ：503228080
</small></p>]]></content:encoded>
			<wfw:commentRss>http://www.vpser.net/build/vps-nginx-mysql-php.html/feed</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

