07 2014 档案
Memcached的相关技术难点
摘要:基本问题1、memcached的基本设置 1)启动Memcache的服务器端 # /usr/local/bin/memcached -d -m 10 -u root -l 192.168.0.200 -p 12000 -c 256 -P /tmp/memcached.pid-d选项是启动一个守护进程... 阅读全文
posted @ 2014-07-19 22:53 pushStack
PHP 安装memcache.so 和memcached.so
摘要:一、memcache.so 的安装wget http://pecl.php.net/get/memcache-2.2.7.tgztar zxvf memcache-2.2.7.tgz./configure --enable-memcache --with-php-config=/usr/local/... 阅读全文
posted @ 2014-07-19 18:11 pushStack 阅读(1067) 评论(0) 推荐(0)
linux 安装memcached
摘要:一、安装libeventsudo wget http://www.monkey.org/~provos/libevent-1.3.tar.gzsudo tar zxvf libevent-1.3.tar.gzcd libevent-1.3sudo ./configure -prefix=/usrsu... 阅读全文
posted @ 2014-07-19 13:57 pushStack 阅读(173) 评论(0) 推荐(0)
PHP使用Mongodb
摘要:一.安装Mongodb的PHP扩展wget http://pecl.php.net/get/mongo-1.2.7.tgz //下载扩展包tar zxvf mongo-1.2.7.tgzcd mongo-1.2.7/usr/local/php/bin/phpize./configure -with-... 阅读全文
posted @ 2014-07-18 23:49 pushStack 阅读(285) 评论(0) 推荐(0)
shell删除.svn文件夹
摘要:find . -name '*.svn' |xargs rm -rf 阅读全文
posted @ 2014-07-18 00:22 pushStack 阅读(256) 评论(0) 推荐(0)
Bash shell编程
摘要:1.在比较操作上,整数变量和字符串变量各不相同,详见下表:对应的操作整数操作字符串操作相同-eq=不同-ne!=大于-gt>小于-lt> >>= 表示位左右移一位操作& &= | |= 表示按位与、位或操作~ ! 表示非操作^ ^= 表示异或操作 关系运算符 = == != 表示大于、小于、大... 阅读全文
posted @ 2014-07-17 22:31 pushStack 阅读(166) 评论(0) 推荐(0)
fopen() r+、w+属性详解
摘要:r+具有读写属性,从文件头开始写,保留原文件中没有被覆盖的内容;w+具有读写属性,写的时候如果文件存在,会被清空,从头开始写。r 打开只读文件,该文件必须存在。 r+ 打开可读写的文件,该文件必须存在。 w 打开只写文件,若文件存在则文件长度清为0,即该文件内容会消失。若文件不存在则建立该文件。 w... 阅读全文
posted @ 2014-07-17 13:11 pushStack 阅读(5859) 评论(0) 推荐(0)
MySQL触发器
摘要:delimiter |create trigger t1_insert before insert on t1 for each rowbegin insert into t2 values(1,'2','cc');end;|delimiter;//将分隔符置回分号 阅读全文
posted @ 2014-07-13 23:02 pushStack 阅读(159) 评论(0) 推荐(0)
PHP获取客户端的IP
摘要:function getClientIP(){ global $ip; if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP"); else if(getenv("HTTP_X_FORWARDED_FOR"))//用了代理服务器时 ... 阅读全文
posted @ 2014-07-13 21:22 pushStack 阅读(154) 评论(0) 推荐(0)
MYSQL SET ENUM字段类型
摘要:show create table stu;//显示建表语句create table t1(t enum('a','b','c'));insert into t1 values('a');create table t2(t set('a','b','c'));insert into t2 value... 阅读全文
posted @ 2014-07-08 22:32 pushStack 阅读(468) 评论(0) 推荐(0)
Mysql 性能优化
摘要:1.optimize table2.analyze table3.尽量将列声明为NOT NULL4.Mysql只用前缀索引,避免在已有索引前缀上再建立索引,如index(a,b)上不要再建立index(a)5.索引装入Key Cache Load index into cache table1;6.... 阅读全文
posted @ 2014-07-06 00:54 pushStack 阅读(222) 评论(0) 推荐(0)
Mysql 索引类型
摘要:索引类型1.普通索引create index index_name on t_user(name(12));2.唯一索引:允许表中存在多条记录为空的记录create unique index index_name on t_user(name(12));3.主键索引:不允许有空值create tab... 阅读全文
posted @ 2014-07-06 00:30 pushStack 阅读(920) 评论(0) 推荐(0)
MySQL check table/optimize table/analyze table/REPAIR TABLE
摘要:check table:检查InnoDB和MyIsam是否有错误。检查表或者视图是否存在错误,对 MyISAM 和 InnoDB 存储引擎的表有作用。对于 MyISAM 存储引擎的表进行表检查,也会同时更新关键字统计数据。CHECK TABLE tbl_name [, tbl_name] [opti... 阅读全文
posted @ 2014-07-05 23:14 pushStack 阅读(1481) 评论(0) 推荐(0)
修改mysql root的密码
摘要:use mysql;update user set Password = Password('newPwd') where user='root';//更改root用户的密码flush privileges; 阅读全文
posted @ 2014-07-05 19:11 pushStack 阅读(144) 评论(0) 推荐(0)
where VS having
摘要:where 和 having 的区别: WHERE 子句不能包含聚集函数; 因为试图用聚集函数判断那些行输入给聚集运算是没有意义的。相反,HAVING 子句总是包含聚集函数 having一般跟在group by之后,执行记录组选择的一部分来工作的。 where则是执行所有数据来工作的。再者havi... 阅读全文
posted @ 2014-07-05 19:10 pushStack 阅读(234) 评论(0) 推荐(0)
MyISAM VS InnoDB
摘要:A.构成上的区别: InnoDB只在磁盘上存储一个文件.frm 每个MyISAM在磁盘上存储成三个文件。第一个文件的名字以表的名字开始,扩展名指出文件类型: 文件存储表定义 .frm 数据文件的扩展名为.MYD (MYData) 索引文件的扩展名是.MYI (MYIndex)... 阅读全文
posted @ 2014-07-05 18:38 pushStack 阅读(207) 评论(0) 推荐(0)
通过profile优化SQL语句
摘要:开启profile优化SQL语句:set profiling=1;执行SQL语句show profiles;show profile for query 2;//根据query_id 查看某个查询的详细时间耗费SHOW STATUS LIKE 'last_query_cost';//查询上一条语句执... 阅读全文
posted @ 2014-07-05 18:12 pushStack 阅读(296) 评论(0) 推荐(0)
数据库隔离级别
摘要:隔离级别 脏读(Dirty Read) 不可重复读(NonRepeatable Read) 幻读(Phantom Read)读未提交(Read uncommitted) 可能 可能 可能读已提交(Read committed... 阅读全文
posted @ 2014-07-05 18:02 pushStack 阅读(481) 评论(0) 推荐(0)