<?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>ubuntu,debian,redhat -linuxany.com &#187; MySQL</title>
	<atom:link href="http://www.linuxany.com/archives/category/database/mysql/feed" rel="self" type="application/rss+xml" />
	<link>http://www.linuxany.com</link>
	<description></description>
	<lastBuildDate>Thu, 26 Jan 2012 08:59:02 +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>MySQL 数据库性能优化之SQL优化</title>
		<link>http://www.linuxany.com/archives/1926.html</link>
		<comments>http://www.linuxany.com/archives/1926.html#comments</comments>
		<pubDate>Sun, 04 Dec 2011 14:40:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[select]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1926</guid>
		<description><![CDATA[注：这篇文章是以 MySQL 为背景，很多内容同时适用于其他关系型数据库，需要有一些索引知识为基础 优化目标 减少 IO 次数 IO永远是数据库最容易瓶颈的地方，这是由数据库的职责所决定的，大部分数据库操作中超过90%的时间都是 IO 操作所占用的，减少 IO 次数是 SQL 优化中需要第一优先考虑，当然，也是收效最明显的优化手段。 降低 CPU 计算 除了 IO 瓶颈之外，SQL优化中需要考虑的就是 CPU 运算量的优化了。order by, group by,distinct … 都是消耗 CPU 的大户（这些操作基本上都是 CPU 处理内存中的数据比较运算）。当我们的 IO 优化做到一定阶段之后，降低 CPU 计算也就成为了我们 SQL 优化的重要目标 优化方法 改变 SQL 执行计划 明确了优化目标之后，我们需要确定达到我们目标的方法。对于 SQL 语句来说，达到上述2个目标的方法其实只有一个，那就是改变 SQL 的执行计划，让他尽量“少走弯路”，尽量通过各种“捷径”来找到我们需要的数据，以达到 “减少 IO 次数” 和 “降低 CPU 计算” 的目标 常见误区 [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1926.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL show系列命令总结</title>
		<link>http://www.linuxany.com/archives/1920.html</link>
		<comments>http://www.linuxany.com/archives/1920.html#comments</comments>
		<pubDate>Sun, 04 Dec 2011 14:13:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[grants]]></category>
		<category><![CDATA[show]]></category>
		<category><![CDATA[status]]></category>
		<category><![CDATA[tables]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1920</guid>
		<description><![CDATA[01、show tables或show tables from database_name; — 显示当前数据库中所有表的名称 02、show databases; — 显示mysql中所有数据库的名称 03、show columns from table_name from database_name; 或show columns from database_name.table_name; — 显示表中列名称 04、show grants for user_name; — 显示一个用户的权限，显示结果类似于grant 命令 05、show index from table_name; — 显示表的索引 06、show status; — 显示一些系统特定资源的信息，例如，正在运行的线程数量 07、show variables; — 显示系统变量的名称和值 08、show processlist; — 显示系统中正在运行的所有进程，也就是当前正在执行的查询。大多数用户可以查看他们自己的进程，但是如果他们拥有process权限，就可以查看所有人的进程，包括密码。 09、show table status; — 显示当前使用或者指定的database中的每个表的信息。信息包括表类型和表的最新更新时间 10、show privileges; [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1920.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL 压力测试工具</title>
		<link>http://www.linuxany.com/archives/1651.html</link>
		<comments>http://www.linuxany.com/archives/1651.html#comments</comments>
		<pubDate>Mon, 29 Aug 2011 14:47:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Performents]]></category>
		<category><![CDATA[JDBHammer]]></category>
		<category><![CDATA[mysqlslap]]></category>
		<category><![CDATA[SysBench]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1651</guid>
		<description><![CDATA[第一、mysqlslap MySQL从5.1.4版开始带有一个压力测试工具mysqlslap，通过模拟多个并发客户端访问mysql来执行测试，使用起来非常的简单。通过mysqlslap –help可以获得可用的选项，这里列一些主要的参数，更详细的说明参考官方手册。 –auto-generate-sql, -a 自动生成测试表和数据 –auto-generate-sql-load-type=type 测试语句的类型。取值包括：read，key，write，update和mixed(默认)。 –number-char-cols=N, -x N 自动生成的测试表中包含多少个字符类型的列，默认1 –number-int-cols=N, -y N 自动生成的测试表中包含多少个数字类型的列，默认1 –number-of-queries=N 总的测试查询次数 –query=name,-q 使用自定义脚本执行测试，例如可以调用自定义的一个存储过程或者sql语句来执行测试。 –create-schema 测试的schema，MySQL中schema也就是database –commint=N 多少条DML后提交一次 –compress, -C 如果服务器和客户端支持都压缩，则压缩信息传递 –concurrency=N, -c N 并发量，也就是模拟多少个客户端同时执行select。可指定多个值，以逗号或者–delimiter参数指定的值做为分隔符 –engine=engine_name, -e engine_name 创建测试表所使用的存储引擎，可指定多个 –iterations=N, -i N 测试执行的迭代次数 –detach=N 执行N条语句后断开重连 –debug-info, -T 打印内存和CPU的信息 –only-print 只打印测试语句而不实际执行 测试的过程需要生成测试表，插入测试数据，这个mysqlslap可以自动生成，默认生成一个mysqlslap的schema，如果已经存在则先删除，这里要注意了，不要用–create-schema指定已经存在的库，否则后果可能很严重。可以用–only-print来打印实际的测试过程： $mysqlslap -a --only-printDROP SCHEMA IF EXISTS `mysqlslap`;CREATE SCHEMA [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1651.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL 减少主从数据同步延迟的几个方案</title>
		<link>http://www.linuxany.com/archives/1632.html</link>
		<comments>http://www.linuxany.com/archives/1632.html#comments</comments>
		<pubDate>Sun, 28 Aug 2011 16:09:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[slave]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1632</guid>
		<description><![CDATA[基于局域网的master/slave机制在通常情况下已经可以满足’实时’备份的要求了。如果延迟比较大，就先确认以下几个因素： 1. 网络延迟2. master负载3. slave负载 另外，再介绍2个可以减少延迟的参数 –slave-net-timeout=seconds&#160; &#160; &#160;单位为秒 默认设置为 3600秒 参数含义：当slave从主数据库读取log数据失败后，等待多久重新建立连接并获取数据 –master-connect-retry=seconds&#160; &#160;单位为秒 默认设置为 60秒 参数含义：当重新建立主从连接时，如果连接建立失败，间隔多久后重试。 您还可能感兴趣的内容MySQL的Master/Slave同步状态查询]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1632.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Amoeba实现DB主从读写分离</title>
		<link>http://www.linuxany.com/archives/1624.html</link>
		<comments>http://www.linuxany.com/archives/1624.html#comments</comments>
		<pubDate>Sun, 28 Aug 2011 15:44:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[amoeba]]></category>
		<category><![CDATA[ha-proxy]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1624</guid>
		<description><![CDATA[Amoeba的简介 Amoeba(变形虫)项目,专注分布式数据proxy 开发.座落与Client、DB Server(s)之间.对客户端透明.具有负载均衡、高可用性、sql过滤、读写分离、可路由相关的query到目标数据库、可并发请求多台数据库合并结果. 主要解决了哪些问题： • 降低数据切分带来的复杂多数据库结构• 提供切分规则并降低数据切分规则给应用带来的影响• 降低db 与客户端的连接数• 读写分离 这里关于mysql的安装就不说了,网上的教程比较多. 实现mysql的主从复制 在master服务器上执行如下命令: #mysql –uroot –ptestmysql&#62; grant replication slave,file on *.* to 'linuxany'@'10.10.0.77' identified by '123456';mysql&#62; flush privileges;mysql&#62; exit; //修改master的my.cnf的配置 log-bin=mysql-bin&#160; &#160; &#160; &#160; &#160; &#160; //打开mysql二进制日志server-id = 1&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; //设置mysql_id，主从不能相同binlog-do-db=test&#160; &#160; &#160; &#160; &#160; &#160; //设置二进制日志记录的库sync_binlog=1 //修改slave的my.cnf的配置 [...]]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1624.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL 提高导入导出速度的几个方案</title>
		<link>http://www.linuxany.com/archives/1616.html</link>
		<comments>http://www.linuxany.com/archives/1616.html#comments</comments>
		<pubDate>Tue, 09 Aug 2011 15:43:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1616</guid>
		<description><![CDATA[MySQL导出的SQL语句在导入时有可能会非常非常慢，在处理百万级数据的时候，可能导入要花几小时。在导出时合理使用几个参数，可以大大加快导 入的速度。 -e 使用包括几个VALUES列表的多行INSERT语法;–max_allowed_packet=XXX 客户端/服务器之间通信的缓存区的最大大小;–net_buffer_length=XXX TCP/IP和套接字通信缓冲区大小,创建长度达net_buffer_length的行。 注意：max_allowed_packet 和 net_buffer_length 不能比目标数据库的设定数值 大，否则可能出错。 首先确定目标数据库的参数值 mysql&#62; show variables like ‘max_allowed_packet’;mysql&#62; show variables like ‘net_buffer_length’; 根据参数值书写 mysqldump 命令，如： # mysqldump -uroot -p dbhost -e –max_allowed_packet=16777216 –net_buffer_length=16384 &#62; linuxany_com_db_host.sql OK，现在速度就很快了，主要注意的是导入和导出端的 max_allowed_packet 和 net_buffer_length 这2个参数值设定，弄大点就OK了 其实，最快的方法，是直接COPY数据库目录，不过记得先停止 MySQL 服务。 您还可能感兴趣的内容mysqldump备份时出现when using LOCK TABLES]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1616.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL:使用tcmalloc提升数据库性能</title>
		<link>http://www.linuxany.com/archives/1388.html</link>
		<comments>http://www.linuxany.com/archives/1388.html#comments</comments>
		<pubDate>Sat, 02 Oct 2010 12:33:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.linuxany.com/?p=1388</guid>
		<description><![CDATA[google的开源性能优化工具包 perftool 被证明对提高应用程序性能确有帮助. tcmalloc是其中一个, 与标准的malloc相比, 在内存的分配上效率很高; 编译mysql时建议使用tcmalloc库– 简单来说, 只要在./configure 后生成的Makefile里改一下, 在连接库的那行最后面加上 -ltcmalloc即可. 如果已经使用的是已编译的binary,或者只想简单测试一下tcmalloc的效果, 可以用LD_PRELOAD环境变量制定运行时使用tcmalloc库; 例如在mysqld_safe里加入 export LD_PRELOAD=/usr/local/lib/libtcmalloc.so 确定程序是否使用tcmalloc库可以用lsof命令: lsof -n&#124; grep tcmalloc ibunwind: http://www.nongnu.org/libunwind/ tcmalloc: http://goog-perftools.sourceforge.net/doc/tcmalloc.html 详细的安装步骤： #tar zxvf libunwind-0.98.6.tar.gz#cd libunwind-0.98.6#./configure#make#make install #tar zxvf google-perftools-0.94.1.tar.gz#cd google*#./configure#make#make install 打开 mysqld_safe 脚本 (默认在/usr/bin/mysqld_safe) 在此脚本文件开始加入 LD_PRELOAD=&#34;/usr/local/lib/libtcmalloc.so&#34;#/usr/local/mysql5/bin/mysqld_safe &#38; 您还可能感兴趣的内容深入浅出Linux操作系统的优化和微调有关技术管理的一些思考让Apache支持中文目录Monitor Servers and Clients using Munin in UbuntuPostfix:邮件队列简介及队列操作命令]]></description>
		<wfw:commentRss>http://www.linuxany.com/archives/1388.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

