- 博客(10)
- 收藏
- 关注
原创 mysql 优化(1)
1. 索引优化:索引失效的情况:1. like '%3' // like时,%在第一个字符,正则没有like快2. 使用where id>1 and id3. 使用and或者or的时候,and和or前面两个字段都要加索引,否则索引可能会失效; 如name='user1' and score='60',则name和score都要加索引,否则索引可能会失效4. 如果列类型是字符
2017-09-01 17:37:51
227
转载 mysql优化(2)
转载自:http://www.jb51.net/article/39221.htm1.对查询进行优化,应尽量避免全表扫描,首先应考虑在 where 及 order by 涉及的列上建立索引。 2.应尽量避免在 where 子句中使用!=或3.应尽量避免在 where 子句中对字段进行 null 值判断,否则将导致引擎放弃使用索引而进行全表扫描,如: select
2017-09-01 17:37:15
211
原创 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
280
原创 mysql主主复制
1. 需要有两台主机假设ip地址分别是192.168.165.135, 192.168.165.1362. 创建同步用户在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
转载 MySQL5.7 利用keepalived来实现mysql双主热备
服务器准备Keepalived: 192.168.165.135Keepalived: 192.168.165.136MySQL-master1: 192.168.165.135MySQL-master2: 192.168.165.136一. 安装mysql5.7, 并配置主主备份二. 在mysql-master1 上部署Keepaliv
2017-09-01 17:34:29
2444
原创 Laravel5.4 下nginx配置
一、配置nginx.conf文件(一定要配置本机的hosts文件,否则也不能路由)# power by www.phpStudy.net #user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#err
2017-09-01 17:33:23
2700
原创 Laravel相关函数
有关Request:use Illuminate\Http\Request;Request $request$request->ajax(); // 判断是否为ajax请求Request::segment(1) == 'search'; // 获取uri的一部分(不太确定下标是从0还是1开始的),判断uri是不是以search开头Request::is('searc
2017-09-01 17:32:23
260
原创 Phpstorm设置
文件编码File->Settings->Editor->File Encondings IDE Encondings:IDE编码 Project Encoding:项目编码 Default encoding for properties files:默认文件编码设置快捷键File->Settings->Keymap显示空格File->Sett
2017-09-01 17:31:41
1233
转载 yii2源码(2)--路由
在yii2源码(1)--执行流程 中提到,在\yii\web\Application.php文件中有一下代码:public function handleRequest($request){ if (empty($this->catchAll)) { list ($route, $params) = $request->resolve();//取出路由及参数,下
2017-09-01 16:59:39
655
转载 yii2源码(1)--执行流程
转载自:http://www.yiichina.com/code/546Yii2底层分析我是从入口处分析的。$mysiteRoot/frontend首先:$mysiteRoot/frontend/index.php$application = new yii\web\Application($config);//先从这入手$application->run()
2017-09-01 16:05:04
465
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人