<?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>落 &#187; Database</title>
	<atom:link href="http://liluo.org/class/development/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://liluo.org</link>
	<description>落就是一道风景线……</description>
	<lastBuildDate>Tue, 09 Aug 2011 11:22:28 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Linux中安装MongoDB及简单入门</title>
		<link>http://liluo.org/2011/03/linux%e4%b8%ad%e5%ae%89%e8%a3%85mongodb%e5%8f%8a%e7%ae%80%e5%8d%95%e5%85%a5%e9%97%a8/</link>
		<comments>http://liluo.org/2011/03/linux%e4%b8%ad%e5%ae%89%e8%a3%85mongodb%e5%8f%8a%e7%ae%80%e5%8d%95%e5%85%a5%e9%97%a8/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 06:57:21 +0000</pubDate>
		<dc:creator>落落</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[MongoDB]]></category>

		<guid isPermaLink="false">http://liluo.org/?p=659</guid>
		<description><![CDATA[MongoDB是一个使用由C++编写的基于分布式文件存储的数据库开源项目，旨在为WEB应用提供可护展的高性能数据存储解决方案。下面说下安装方法以及简单入门知识。
1、下载
到官网 http://mongodb.org 去下载最新的稳定版本，目前是 mongodb-linux-i686-1.8.0.tgz
2、解压


mv mongodb-linux-i686-1.8.0.tgz /usr/local/
cd /usr/local
tar xvf mongodb-linux-i686-1.8.0.tgz
mv mongodb-linux-i686-1.8.0 mondodb
rm -y mongodb-linux-i686-1.8.0.tgz



3、运行
需要创建一个存放数据的目录(默认是/data/db/)，创建目录并启动：


mkdir -p /data/db/
/usr/local/mongodb/bin/mongod


如果想使用自己指定的目录来存储数据，加上--dbpath选项：

/usr/local/mongodb/bin/mongod --dbpath /path/to/data/dir

4、使用JavaScript Shell工具简单入门
默认链接的是test数据库

/usr/local/mongodb/bin/mongo
MongoDB shell version: 1.8.0
connecting to: test
&#62;

MongoDB简单入门
内容引用鱼哥博客



插入数据到集合


下面我们来建立一个test的集合并写入一些数据. 建立两个对象, j 和 t , 并保存到集合中去.
在例子里 ‘&#62;’ 来表示是 shell 输入提示符


&#62; j = { name : "mongo" };
{"name" : "mongo"}
&#62; t = { x : 3 };
{ "x" : 3  }
&#62; db.things.save(j);
&#62; db.things.save(t);
&#62; [...]]]></description>
		<wfw:commentRss>http://liluo.org/2011/03/linux%e4%b8%ad%e5%ae%89%e8%a3%85mongodb%e5%8f%8a%e7%ae%80%e5%8d%95%e5%85%a5%e9%97%a8/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Memcached 安装、使用（Python操作）以及常用方法</title>
		<link>http://liluo.org/2011/03/memcached-install-python-use/</link>
		<comments>http://liluo.org/2011/03/memcached-install-python-use/#comments</comments>
		<pubDate>Mon, 14 Mar 2011 11:03:12 +0000</pubDate>
		<dc:creator>落落</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Memcached]]></category>

		<guid isPermaLink="false">http://liluo.org/?p=644</guid>
		<description><![CDATA[Memcached官网 memcached.org
简单介绍：memcached很强大，它可以支持分布式的共享内存缓存，大型站点都用它。对小站点来说，有足够内存的话，使用它也可以得到超赞的效果。
使用目的：由前面的介绍看到，大家使用它都是为了速度，不过我却是为了解决Session在不同浏览器中偶尔丢失的数据。其实也不能怪浏览器啦，主要是我需要一个dict类型的session，哈哈。
安装
Linux
安装包
对于大多数Linux发行版本来说，可以使用官方推荐的方法：
Debian/Ubuntu
apt-get install memcached
Redhat/Fedora/CentOS
yum install memcached
源码安装(CentOS 5.5)
1、下载libevent（依赖） 和memcached
分别到以下引用地址下载最新版本：
引用地址 http://www.monkey.org/~provos/libevent/ 
引用地址:http://code.google.com/p/memcached/downloads/list
2、安装ibevent（依赖） 和memcached
libevent(目前最新是libevent-2.0.10-stable.tar.gz，请注意版本号)
tar xvf libevent-2.0.10-stable.tar.gz
cd libevent-2.0.10-stable
./configure --prefix=/usr/local/libevent/
make
make install
接着，ls /usr/local/libevent/lib，将查看到的第一个类似libevent-X.X.so.X
ln -s /usr/local/libevent/lib/libevent-2.0.so.5  /lib/libevent-2.0.so.5
memcached (目前最新是1.4.5，请注意版本号)
tar zxvf  memcached-1.4.5.tar.gz
cd memcached-1.4.5
./configure --prefix=/usr/local/memcached --with-libevent=/usr/local/libevent/
make 
make install
3、启动memcached
启动参数说明(这是我是复制粘贴的，如有错误请指正)：
-d 选项是启动一个守护进程
-m 是分配给Memcache使用的内存数量，单位是MB，默认64MB
-M return error on memory exhausted (rather than removing items)
-u 是运行Memcache的用户，如果当前为root 的话，需要使用此参数指定用户
-l 是监听的服务器IP地址，默认为所有网卡
-p 是设置Memcache的TCP监听的端口，最好是1024以上的端口
-c 选项是最大运行的并发连接数，默认是1024
-P 是设置保存Memcache的pid文件
-f chunk size growth factor (default: 1.25)
-I Override the size of [...]]]></description>
		<wfw:commentRss>http://liluo.org/2011/03/memcached-install-python-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostgreSQL 9.0 安装乱乱记</title>
		<link>http://liluo.org/2010/11/postgresql-9-0-%e5%ae%89%e8%a3%85%e4%b9%b1%e4%b9%b1%e8%ae%b0/</link>
		<comments>http://liluo.org/2010/11/postgresql-9-0-%e5%ae%89%e8%a3%85%e4%b9%b1%e4%b9%b1%e8%ae%b0/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 02:24:21 +0000</pubDate>
		<dc:creator>落落</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Postgresql]]></category>

		<guid isPermaLink="false">http://liluo.org/?p=606</guid>
		<description><![CDATA[PostgreSQL 9已经发布了，我属于新版本控，于是计划着在VPS( win server 2003)和服务器(CentOS 5.5)上安装，先不讲过程，结果是服务器上已成功安装，VPS主动放弃。在些提醒各位，PostgreSQL 9安装很纠结，选择需慎重。

一、VPS（win server 2003）
直接在官网下载 win安装包.exe文件,按照8.4版本的习惯一路直下，在安装完成的时候出现 “ Problem running post-install step. Installation may not complete correctly. The database cluster initialisation failed.” GG一下，看到有人讲在非英文系统下安装时Local选择非默认语言，如Singapore或c（别听那些不靠谱的说选Chinese，在9.0版本中压根没那选项）。于是把自己电脑上（ win xp）的8.4卸载，重新安装选择Singapore（新加坡，对中文支持比较好），依然一路直下，OK搞定。然后把VPS卸载重新安装，依然出错，泪流满面……把公司另台电脑格掉装上win server 2003，安装时local选Singapore，结果成功。后来又在VPS上尝试local时选C或者其他，依然失败，然后又拿8.4甚至8.3版本安装失败依然。在其他win系统（包括同版本的win server 2003）中可正常安装，好吧VPS，到期我就换掉你丫的。
win正常安装pg9请注意：中文版系统安装时local一定选择非默认语言。



二、服务器（CentOS 5.5）
一直想给服务器（使用CentOS）装上PostgreSQL，最初的时候使用yum，结果一看是在Down 8.3版本（丫的先不说9.0版已经横空出世，8.4版可出来N久了），直接ctrl+C。
之后参照鱼哥(smallfish)的教程（点击）下载了并安装了pg9初始化时:
service postgresql initdb
Usage: /etc/init.d/postgresql {start&#124;stop&#124;restart&#124;reload&#124;status}
@##@！￥￥@#什么东东，可以使用了吗？
service postgresql start
Starting PostgreSQL: ok
service postgresql stop
Stopping PostgreSQL: pg_ctl: PID file "/usr/local/pgsql/data/postmaster.pid" does not exist
Is server running?
什么状况？欲哭无泪……于是等yum安装Pg版本升级到9.0。前天几发现已经到9.0了:
yum postgresql [...]]]></description>
		<wfw:commentRss>http://liluo.org/2010/11/postgresql-9-0-%e5%ae%89%e8%a3%85%e4%b9%b1%e4%b9%b1%e8%ae%b0/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Ubuntu 安装 Postgresql、Pgadmin</title>
		<link>http://liluo.org/2010/07/ubuntu-%e5%ae%89%e8%a3%85-postgresql%e3%80%81pgadmin/</link>
		<comments>http://liluo.org/2010/07/ubuntu-%e5%ae%89%e8%a3%85-postgresql%e3%80%81pgadmin/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 06:24:26 +0000</pubDate>
		<dc:creator>落落</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Postgresql]]></category>

		<guid isPermaLink="false">http://liluo.org/?p=554</guid>
		<description><![CDATA[第一步：在Ubuntu下安装Postgresql

sudo apt-get install postgresql
以上指令安装服务端和命令行客户端psql。
/usr/lib/postgresql/8.4/              存放postgresql相关的二进制文件
/usr/lib/postgresql/8.4/bin/        可执行文件
/usr/lib/postgresql/8.4/lib/         共享库文件
/etc/postgres/8.4/main/              存放postgresql配置文文件
/var/lib/postgresql/                    postgres用户的主文件夹
第二步：修改PostgreSQL数据库的默认用户postgres的密码
PostgreSQL数据默认会创建一个postgres的帐号用户作为数据库的管理员，密码是随机的，所以：
首先，我们需要重置“postgres”用户的密码。
命令行如下：
sudo -u postgres psql(或者sudo su postgres -c psql)—&#62;运行psql,psql是一个标准的postgressql客户端
postgres=# ALTER USER postgres WITH PASSWORD ‘postgres’;—&#62;修改postgres的密码为postgres,不要忘记添加分号(回车后分号之前的sql语句才会立即执行)
postgres=# \q—&#62;退出
修改了数据库中的密码之后，我们还需要修改linux下的用户“postgres”的密码：设定成与数据库中postgres帐号相同的密码，即postgres。
sudo passwd -d postgres———&#62;删除密码
sudo -u postgres passwd(或者 sudo su postgres -c passwd)—–&#62;创建密码
然后输入跟之前一样的密码。
现在，我们就可以在数据库服务器上用 postgres帐号通过psql或者pgAdmin等等客户端操作数据库了（暂时还不能远程访问）。
第三步：修改PostgresSQL数据库配置实现远程访问
首先，我们需要编辑postgresql.conf：
sudo gedit /etc/postgresql/8.4/main/postgresql.conf
现在，我们需要修改“连接和权 限”两行。
改变行：#listen_addresses = ‘localhost’ 修改为：listen_addresses = ‘*’
改变行：#password_encryption = on 修改为：password_encryption = on
保存并关闭gedit。
最后一步，我们必须设置谁才可以操作数据服务器，这一切都是在pg_hba.conf中完成的。
sudo gedit /etc/postgresql/8.4/main/pg_hba.conf
把以下内容添加到 pg_hba.conf底部：
# to allow your [...]]]></description>
		<wfw:commentRss>http://liluo.org/2010/07/ubuntu-%e5%ae%89%e8%a3%85-postgresql%e3%80%81pgadmin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

