欢迎转载,请注明作者、出处。作者:刘春雷blog:http://blog.itpub.net/28823725/
如有疑问,欢迎留言~
Inception部署测试--刘春雷 20170801
如果你想学习inception如果你想学习flask~那么此篇文章适合你~
1、下载https://github.com/mysql-inception/inception2、安装yum -y install cmake libncurses5-dev libssl-dev g++ bisonopenssl-devel.x86_64
unzip inception-master.zip
cdinception-mastersh -x inception_build.sh debug
cd /chunlei/inception/inception
mkdir log
mkdir etc
cd etc
安装完毕后添加配置文件:
vim inc.cnf[inception]general_log=1general_log_file=/chunlei/inception/inception/log/inception.logport=7001socket=/chunlei/inception/inception/inc.socketcharacter-set-client-handshake=0character-set-server=utf8inception_remote_system_password=123456inception_remote_system_user=rootinception_remote_backup_port=6001inception_remote_backup_host=127.0.0.1inception_support_charset=utf8mb4inception_enable_nullable=0inception_check_primary_key=1inception_check_column_comment=1inception_check_table_comment=1inception_osc_min_table_size=1inception_osc_bin_dir=/chunlei/oscinception_osc_chunk_time=0.1inception_ddl_support=1inception_enable_blob_type=1inception_check_column_default_value=13、启动/chunlei/inception/inception-master/debug/mysql/bin/Inception --defaults-file=/chunlei/inception/inception/etc/inc.cnf &
登录:mysql -uroot -h227.0.0.1 -P7001
elcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 2Server version: Inception2.1.50 1
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>inception get variables;测试
4、界面界面化:网上有封装好的flask在网上下载一个web封装的界面安装过程如下:下载地址:https://github.com/dbalihui/inception_web
安装flaskeasy_install flask
easy_installflask_wtf
easy_installflask-script
easy_installflask-debugtoolbar
数据库建立库:create database sql_check创建用户:GRANT ALL PRIVILEGES ON *.* TO 'dba'@'%' identified by '123456'
修改配置文件cd/chunlei/inception/flask/inception_web-master/appviinception.py修改:conn=MySQLdb.connect(host='127.0.0.1',user='dba',passwd='123456',db='sql_check',port=7001,use_unicode=True, charset="utf8")
运行:./run.py runserver --host 172.16.16.2
http://182.61.39.142:5000/
测试:create table test1 (id int auto_increment,name varchar(10),primary key(id))