cryptdb 安装测试

1、更新源(推荐香港中文大学的源,注释掉sources.list里源)
 
  sudo cp /etc/apt/sources.list /etc/apt/sources-backup.list
  sudo vi /etc/apt/sources.list
  deb [url=http://ftp.cuhk.edu.hk/pub/Linux/ubuntu]http://ftp.cuhk.edu.hk/pub/Linux/ubuntu[/url] quantal main restricted universe multiverse
  deb [url=http://ftp.cuhk.edu.hk/pub/Linux/ubuntu]http://ftp.cuhk.edu.hk/pub/Linux/ubuntu[/url] quantal-security main restricted universe multiverse
  deb [url=http://ftp.cuhk.edu.hk/pub/Linux/ubuntu]http://ftp.cuhk.edu.hk/pub/Linux/ubuntu[/url] quantal-updates main restricted universe multiverse
  deb [url=http://ftp.cuhk.edu.hk/pub/Linux/ubuntu]http://ftp.cuhk.edu.hk/pub/Linux/ubuntu[/url] quantal-backports main restricted universe multiverse
  deb [url=http://ftp.cuhk.edu.hk/pub/Linux/ubuntu]http://ftp.cuhk.edu.hk/pub/Linux/ubuntu[/url] quantal-proposed main restricted universe multiverse
  deb-src [url=http://ftp.cuhk.edu.hk/pub/Linux/ubuntu]http://ftp.cuhk.edu.hk/pub/Linux/ubuntu[/url] quantal main restricted universe multiverse
  deb-src [url=http://ftp.cuhk.edu.hk/pub/Linux/ubuntu]http://ftp.cuhk.edu.hk/pub/Linux/ubuntu[/url] quantal-security main restricted universe multiverse
  deb-src [url=http://ftp.cuhk.edu.hk/pub/Linux/ubuntu]http://ftp.cuhk.edu.hk/pub/Linux/ubuntu[/url] quantal-updates main restricted universe multiverse
  deb-src [url=http://ftp.cuhk.edu.hk/pub/Linux/ubuntu]http://ftp.cuhk.edu.hk/pub/Linux/ubuntu[/url] quantal-backports main restricted universe multiverse
  deb-src [url=http://ftp.cuhk.edu.hk/pub/Linux/ubuntu]http://ftp.cuhk.edu.hk/pub/Linux/ubuntu[/url] quantal-proposed main restricted universe
  sudo apt-get update
 
2、安装需要的包
 
   sudo apt-get install automake bison bzr cmake make flex g++ git gtk-doc-tools libbsd-dev libevent-dev libglib2.0-dev    
   liblua5.1-0-dev libmysqlclient-dev libncurses5-dev libntl-dev libssl-dev gcc-4.6 g++-4.6
 
3、创建一个目录,下载cryptDB、mysql5.5.14编译
   sudo mkdir crpytdb-inst   
   cd cryptdb-inst
   git clone -b public git://g.csail.mit.edu/cryptdb
   wget [url=http://es.csail.mit.edu/mysql-5.5.14.tar.gz]http://es.csail.mit.edu/mysql-5.5.14.tar.gz[/url]
   tar xzf mysql-5.5.14.tar.gz
   bzr branch lp:mysql-proxy
 
4、编译mysql-proxy
   cd mysql-proxy   
   sh ./autogen.sh
   ./configure --enable-maintainer-mode --with-lua=lua5.1
   make
   sudo  make install
 
5、构建crptdb on Mysql
   sudo groupadd mysql
   sudo useradd -r -g mysql mysql
   cd crytpdb-inst
   cp -R cryptdb/parser/mysql_mods/* mysql-5.5.14/
   rm mysql-5.5.14/sql/sql_yacc.{cc,h}
   cd mysql-5.5.14
   mkdir build
   cd build
   cmake -DWITH_EMBEDDED_SERVER=ON ..
   make
   sudo make install
   cd /usr/local/mysql
   sudo chown -R mysql .
   sudo cp support-files/my-medium.cnf /etc/my.cnf
   sudo scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql/
   cd cd var/log
   sudo mkdir mysql
   sudo /usr/local/mysql/bin/mysqld_safe --lc-messages-dir="/usr/local/mysql/share/english/"
   /usr/local/mysql/bin/mysqladmin -u root password 'letmein'
 
6、构建 CryptDB
   cd cryptdb-inst
   cp conf/config.mk.sample conf/config.mk
   sed -i'' -e"1s%/home/econlive(用户目录)/build%$HOME/cryptdb-inst%" conf/config.mk
   cd cryptdb-inst/cryptdb/conf
   sudo vi config.mk
   MYSRC    := /home/econlive/cryptdb-inst/mysql-5.5.14//mysql源码路径
   把#CXX := g++-4.6去掉
   cd ..
   sudo make
   cd  cd usr/lib
   sudo mkdir mysql
   cd  /home/econlive/cryptdb-inst/cryptdb
   sudo make install
 
7、测试环境准备
  安装mysql客户端:sudo apt-get install mysql-client-core-5.5
  以3306端口登录:mysql -u root -pletmein -h 127.0.0.1 -P 3306
  创建数据库: create database cryptdbtest;
  启动mysql服务:sudo /usr/local/mysql/bin/mysqld_safe --lc-messages-dir="/usr/local/mysql/share/english/"
  开始代理:
              export EDBDIR=/home/econlive/cryptdb-inst/cryptdb/obj
              mysql-proxy --plugins=proxy --event-threads=4 --max-open-files=1024 \
            --proxy-lua-script=$EDBDIR/../mysqlproxy/wrapper.lua \
            --proxy-address=127.0.0.1:3307 \
            --proxy-backend-addresses=localhost:3306
拷贝edb.so
             sudo cp -R ./home/econlive/cryptdb-inst/cryptdb/obj/udf/edb.so /usr/local/mysql/lib/plugin/edb.so
以3307代理登录:
             mysql -u root -pletmein -h 127.0.0.1 -P 3307 cryptdbtest
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值