inception安装步骤---自己整理的安装步骤
inception安装步骤---自己整理的安装步骤
2015-09-18 15:51 6185人阅读 评论(1) 收藏 举报
分类: inception相关
版权声明:本文为博主原创文章,未经博主允许不得转载。
目录(?)[+]
1. 下载:
https://github.com/mysql-inception/inception 选择下载:
Downloda ZIP
注意安装包:
yum -y install cmake libncurses5-dev libssl-dev g++ bison openssl-devel.x86_64
2. 下载后解压编译:
# unzip inception-master.zip
# cd inception-master
# cmake .
# cmake -DWITH_DEBUG=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/inception -DMYSQL_DATADIR=/data/inception -DWITH_SSL=yes -DCMAKE_BUILD_TYPE=RELEASE-DWITH_ZLIB=bundled-DMY_MAINTAINER_CXX_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Wno-unused-parameter -Woverloaded-virtual" -DMY_MAINTAINER_C_WARNINGS="-Wall -Wextra -Wunused -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement"
# make && make install
# sh -x inception_build.sh debug
报错如下:
-- Build files have been written to: /root/inception-master
+ '[' x '!=' Xcode ']'
+ make install
make: *** 没有规则可以创建目标“install”。 停止。
# sh inception_build.sh debug [linux]
make: *** 没有规则可以创建目标“install”。 停止。
解决办法:# make -j6 && make install
安装完毕后添加配置文件:
#vim /etc/inc.cnf
[root@localhost ~]# cat /etc/inc.cnf
[inception]
general_log=1
general_log_file=/usr/local/inception/data/inception.log
port=6669
socket=/data/workspace/inception_data/inc.socket
character-set-client-handshake=0
character-set-server=utf8
inception_remote_system_password=123456
inception_remote_system_user=root
inception_remote_backup_port=3306
inception_remote_backup_host=127.0.0.1
inception_support_charset=utf8mb4
inception_enable_nullable=0
inception_check_primary_key=1
inception_check_column_comment=1
inception_check_table_comment=1
inception_osc_min_table_size=1
inception_osc_bin_dir=/data/temp
inception_osc_chunk_time=0.1
inception_ddl_support=1
inception_enable_blob_type=1
inception_check_column_default_value=1
//上面配置文件中用到的文件路径,没有的手动创建一下。
#mkdir -p /data/workspace/inception_data/
#mkdir -p /data/temp
6.启动Inception. 现在就到启动时间了,那么启动有两种方式,和MySQL是一样的
1. Inception –defaults-file=inc.cnf
2. Inception –port=6669
//启动inception服务
#/usr/local/inception/bin/Inception --defaults-file=/etc/inc.cnf //启动inception 有2种方式,在这采用配置文件启动方式。
//测试inception。
测试之前创建一个可以连接mysql的用户:用户名wwn 密码:123456 IP:127.0.0.1 保证能正常登陆mysql即可。
# mysql -uroot -h127.0.0.1 -P6669 //登陆inception
登录上去之后,再执行一个命令:
inception get variables;
输出了所有的变量,恭喜你,已经启动成功了,都说了非常简单。
[root@localhost app]# mysql -uroot -h127.0.0.1 -P6669
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 36
Server version: Inception2.0.18-beta 1
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
下面用脚本测试相关的审核语句:
1. 审核表创建语句测试:
[root@localhost ~]# cat aa.py
#!/usr/bin/python
#-\*-coding: utf-8-\*-
import MySQLdb
sql='/*--user=wwn;--password=123456;--host=127.0.0.1;--execute=1;--port=3306;*/\
inception_magic_start;\
use test;\
CREATE TABLE `alifeba_user` (\
`ID` int(11) unsigned NOT NULL auto_increment comment"aaa",\
`username` varchar(50) NOT NULL Default "" comment"aaa",\
`realName` varchar(50) NOT NULL Default "" comment"aaa",\
`age` int(11) NOT NULL Default 0 comment"aaa",\
PRIMARY KEY (`ID`)\
) ENGINE=INNODB DEFAULT CHARSET=utf8mb4 COMMENT="AAAA";\
inception_magic_commit;'
try:
conn=MySQLdb.connect(host='127.0.0.1',user='wwn',passwd='123456',db='wwn',port=6669)
cur=conn.cursor()
ret=cur.execute(sql)
result=cur.fetchall()
num_fields = len(cur.description)
field_names = [i[0] for i in cur.description]
print field_names
for row in result:
print row[0], "¦",row[1],"¦",row[2],"¦",row[3],"¦",row[4],"¦",
row[5],"¦",row[6],"¦",row[7],"¦",row[8],"¦",row[9],"¦",row[10]
cur.close()
conn.close()
except MySQLdb.Error,e:
print "Mysql Error %d: %s" % (e.args[0], e.args[1])
2. 审核增删改语句
[root@localhost ~]# cat bb.py
#!/usr/bin/python
#-\*-coding: utf-8-\*-
import MySQLdb
sql='/*--user=wwn;--password=123456;--host=127.0.0.1;--execute=1;--enable-remote-backup;--port=3306;*/\
inception_magic_start;\
use wwn;\
INSERT INTO v9_wap(siteid,sitename,logo,domain,setting) VALUES ("12","aa","bb","cc","dd");\
delete from v9_wap where siteid=11;\
update v9_wap set sitename="haha" where siteid=10;\
inception_magic_commit;'
try:
conn=MySQLdb.connect(host='127.0.0.1',user='wwn',passwd='123456',db='wwn',port=6669)
cur=conn.cursor()
ret=cur.execute(sql)
result=cur.fetchall()
num_fields = len(cur.description)
field_names = [i[0] for i in cur.description]
print field_names
for row in result:
print row[0], "¦",row[1],"¦",row[2],"¦",row[3],"¦",row[4],"¦",
row[5],"¦",row[6],"¦",row[7],"¦",row[8],"¦",row[9],"¦",row[10]
cur.close()
conn.close()
except MySQLdb.Error,e:
print "Mysql Error %d: %s" % (e.args[0], e.args[1])
*************
3. 在网上下载一个web封装的界面安装过程如下:
下载地址:https://github.com/dbalihui/inception_web
环境配置
python2.7 + flask
先安装依赖模块
pip install flask_wtf
pip install flask-script
pip install flask-debugtoolbar
pip install MySQL-python
使用方法
先将app目录中的inception.py文件里的账号密码改成自己的
记得use sql_check这里要改成自己的数据库名字
在inception_web目录下运行./run.py runserver --host 0.0.0.0
使用浏览器访问你的IP http://192.168.xx.xxx:5000/
运行报错的话是因为没有安装flask组件,请使用pip install xx安装相关组件
所以先升级Python2.7
# wget https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz --no-check-certificate
# tar -xvf Python-2.7.10.tar
# cd Python-2.7.10
# ./configure && make && make install
# /usr/local/bin/python -V
# mv /usr/bin/python /usr/bin/python2.6.6
# ln -s /usr/local/bin/python /usr/bin/python
# python -V //验证版本
# vim /usr/bin/yum //修改#!/usr/bin/python 为#!/usr/bin/python2.6.6,因为yum安装依赖的是2.6版本的python
下面安装模块:
首先安装一个pip
# yum -y install python-pip //这种安装处理是2.6版本的
# wget https://bootstrap.pypa.io/ez_setup.py --no-check-certificate //下载一个ez_setup 安装pip2.7版本的
# python2.7 ez_setup.py
# easy_install-2.7 pip
# pip2.7 install MySQL-python
# yum install mysql-devel //如果报错看看是不是缺失mysql-devel包。
# pip2.7 install flask_wtf
# pip2.7 install flask-script
# pip2.7 install flask-debugtoolbar
安装步骤:
# unzip inception_web-master.zip
# cd inception_web-master
# vim inception.py //修改配置文件
# ./run.py runserver --host 0.0.0.0 //启动服务
配置文件信息如下:
[root@localhost inception_web-master]# cat /root/inception_web-master/app/inception.py
#coding=utf-8
import MySQLdb
def table_structure(mysql_structure):
sql1='/*--user=wwn;--password=123456;--host=192.168.8.97;--execute=1;--port=3306;*/\
inception_magic_start;\
use wwn;' //此处数据库是图形界面框中选择的数据,不然只写create table会报错提示要选择数据库。
sql2='inception_magic_commit;'
sql = sql1 + mysql_structure + sql2
try:
conn=MySQLdb.connect(host='127.0.0.1',user='wwn',passwd='123456',db='wwn',port=6669,use_unicode=True, charset="utf8")
cur=conn.cursor()
ret=cur.execute(sql)
result=cur.fetchall()
num_fields = len(cur.description)
field_names = [i[0] for i in cur.description]
print field_names
for row in result:
print row[0], "|",row[1],"|",row[2],"|",row[3],"|",row[4],"|",row[5],"|",row[6],"|",row[7],"|",row[8],"|",row[9],"|",row[10]
cur.close()
conn.close()
except MySQLdb.Error,e:
print "Mysql Error %d: %s" % (e.args[0], e.args[1])
return result[1][4].split("\n")
inception安装步骤---自己整理的安装步骤的更多相关文章
- CentOS 6.5系统上安装SVN服务器端的方法及步骤
VN其实就是Subversion,分为服务器端和客户端.之前在网上搜了很多方法,都有各种问题,经过自己搜集整理以及实际尝试,总算有个比较靠谱的方法.本文主要介绍CentOS 6.5系统上安装SVN服务 ...
- (转载)WindowsXP上安装和运行神器SqlMap的步骤
在Windows XP上安装和运行SqlMap的步骤…… 1.首先下载SqlMap 点击下载. https://codeload.github.com/sqlmapproject/sqlmap/leg ...
- 安装PHP过程中,make步骤报错:(集合网络上各种解决方法)
安装PHP过程中,make步骤报错:(集合网络上各种解决方法) (1)-liconv -o sapi/fpm/php-fpm /usr/bin/ld: cannot find -liconv coll ...
- 全世界最详细的一步一步搭建RAC步骤(一)---安装操作系统RHEL4.6【weber出品】
全文搭建RAC分为3步骤 <--安装操作系统RHEL4.6> <--配置ASM+裸设备> <--安装集群软件> <--安装数据库软件> ...
- win10 安装 mysql解压版安装步骤
参考资料:win 10 安装 mysql 5.7 网址:http://blog.sina.com.cn/s/blog_5f39af320102wbk0.html 本文参考上面的网址的教程,感谢作者分享 ...
- 初次安装Ubuntu后的若干配置步骤
第一步,安装VMware-tools 按照如下提示安装 首先将压缩包,复制到/home 目录下,将其解压,执行./vmware-install.pl即可 第二步,配置使linux能上网 首先将ubun ...
- ubuntu 14.04 lts安装教程:u盘安装ubuntu 14.04 lts步骤
绿茶小编带来了ubuntu 14.04 lts安装教程,下文详细讲解了u盘安装ubuntu 14.04 lts的步骤,很简单,只需要一个工具就能够轻松使用u盘安装ubuntukylin 14.04系统 ...
- Centos 安装ImageMagick 与 imagick for php步骤详解
现在有很多朋友在使用安装ImageMagick imagick for php了,今天自己也想做但是不知道如何操作,下面我来给大家介绍Centos 安装ImageMagick imagick for ...
- Windows和Linux系统下,虚拟环境安装的全面说明和详细步骤
虚拟环境的创建和使用 用途: 1.在同一台电脑安装同一个包的不同版本 2.记录项目所用的所有的包的版本,方便部署. 如何使用: 1.创建虚拟环境 mkvirtualenv 虚拟环境名 -p pyt ...
随机推荐
- bzoj3924 [Zjoi2015]幻想乡战略游戏 点分树,动态点分
[BZOJ3924][Zjoi2015]幻想乡战略游戏 Description 傲娇少女幽香正在玩一个非常有趣的战略类游戏,本来这个游戏的地图其实还不算太大,幽香还能管得过来,但是不知道为什么现在的网 ...
- jquery中append、prepend, before和after方法的区别(一)
原文:http://blog.csdn.net/woosido123/article/details/64439490 在 jquery中append() 与 prepend()是在元素内插入内容(该 ...
- <编程精粹:编写高质量C语言代码> 读书笔记
0.规则<The Elements of Programming Style><The Elements of Style> 1.假想的编译程序(1)使用编译器提供的所有的可选 ...
- vue2.0组件入门
如何定义一个组件 在根目录src/components/文件夹下新建组件的文件夹Footer.vue组件 在Footer.vue中 <template> <div class=&qu ...
- css3 实现居中的9中方法
<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...
- 标准C程序设计七---51
Linux应用 编程深入 语言编程 标准C程序设计七---经典C11程序设计 以下内容为阅读: <标准C程序设计>(第7版) 作者 ...
- hdu 5459(递推好题)
Jesus Is Here Time Limit: 1500/1000 MS (Java/Others) Memory Limit: 65535/102400 K (Java/Others)To ...
- AC日记——图灵机游戏 codevs 2292
2292 图灵机游戏 时间限制: 1 s 空间限制: 64000 KB 题目等级 : 黄金 Gold 题解 查看运行结果 题目描述 Description [Shadow 1]第二题 ...
- AC日记——Super Mario hdu 4417
Super Mario Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- 洛谷—— P2251 质量检测
https://www.luogu.org/problemnew/show/P2251 题目背景 无 题目描述 为了检测生产流水线上总共N件产品的质量,我们首先给每一件产品打一个分数A表示其品质,然后 ...