
重学-mysql
文章平均质量分 79
潇潇雨木
这个作者很懒,什么都没留下…
展开
-
MySQL5.7 利用keepalived来实现mysql双主热备
服务器准备 Keepalived: 192.168.165.135 Keepalived: 192.168.165.136 MySQL-master1: 192.168.165.135 MySQL-master2: 192.168.165.136 一. 安装mysql5.7, 并配置主主备份 二. 在mysql-master1 上部署Keepaliv转载 2017-09-01 17:34:29 · 2445 阅读 · 0 评论 -
mysql主主复制
1. 需要有两台主机 假设ip地址分别是192.168.165.135, 192.168.165.136 2. 创建同步用户 在192.168.165.135执行如下命令: grant replication slave,file on *.* to 'replication'@'192.168.165.136' identified by '1234';原创 2017-09-01 17:35:42 · 348 阅读 · 0 评论 -
mysql 压力测试
命令:mysqlslap --no-defaults -uroot -proot -a --concurrency=50,100 --number-of-queries 20000 --iterations=5 --engine=myisam,innodb --concurrency=50,100分别模拟50和100个客户端连接 --number-of-queries 20000原创 2017-09-01 17:36:18 · 282 阅读 · 0 评论 -
mysql优化(2)
转载自:http://www.jb51.net/article/39221.htm 1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中使用!=或 3.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: select转载 2017-09-01 17:37:15 · 212 阅读 · 0 评论 -
mysql 优化(1)
1. 索引优化: 索引失效的情况: 1. like '%3' // like时,%在第一个字符,正则没有like快 2. 使用where id>1 and id 3. 使用and或者or的时候,and和or前面两个字段都要加索引,否则索引可能会失效; 如name='user1' and score='60',则name和score都要加索引,否则索引可能会失效 4. 如果列类型是字符原创 2017-09-01 17:37:51 · 230 阅读 · 0 评论