1.操作环境
操作系统:Centos7
语言:Python3.6
参考文章
inception安装使用 https://www.jianshu.com/p/20e87911483f
Pymysql安装 https://blog.csdn.net/zzzcl112/article/details/80503690
2.安装inception
2.1安装基础环境
cd /usr/local 以后的安装,下载操作都在usr/local下进行
yum -y install cmake libncurses5-dev libssl-dev g++ bison gcc gcc-c++ openssl-devel ncurses-devel mysql pymysql
2.2安装bison
注意,Centos7一定要制定bison版本不高于2.6,否则Inception可能会出现编译错误,该下载速度十分缓慢,可以考虑长时间等待或者更换镜像源。
wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz
tar -zxvf bison-2.5.1.tar.gz
cd bison-2.5.1
./configure
make
make install
2.3安装inception
cd /usr/local/
wget https://github.com/mysql-inception/inception/archive/master.zip
unzip inception-master.zip
cd inception-master
sh inception_build.sh builddir linux
2.4修改配置
Nano /etc/inc.cnf
###################
[inception]
general_log=1
general_log_file=inc.log
port=6669
socket=/tmp/inc.socket
character-set-client-handshake=0
character-set-server=utf8# 这里的数据库是填inception的库,也用作备份库
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=utf8
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=/usr/bin
inception_osc_chunk_time=0.1
inception_ddl_support=1
inception_enable_blob_type=1
inception_check_column_default_value=1
###################
2.5启动服务
nohup /usr/local/inception-master/builddir/mysql/bin/Inception --defaults-file=/etc/inc.cnf &
2.6 测试是否安装成功
mysql -uroot -h127.0.0.1 -P 6669 输入后,进入数据库命令行
>inception get variables; 输入后,出现如下表格则说明安装成功
MySQL [(none)]> inception get variables;
+------------------------------------------+---------------------------------------------+
| Variable_name | Value |
+------------------------------------------+---------------------------------------------+
| autocommit | OFF |
| bind_address | * |
| character_set_system | utf8 |
| character_sets_dir | /usr/local/inception-master/share/charsets/ |
| connect_timeout | 10 |
| date_format | %Y-%m-%d |
| datetime_format | %Y-%m-%d %H:%i:%s |
| general_log | ON |
| general_log_file | inc.log |
| inception_check_autoincrement_datatype | ON |
| inception_check_autoincrement_init_value | ON |
| inception_check_autoincrement_name | ON |
| inception_check_column_comment | ON |
| inception_check_column_default_value | ON |
| inception_check_dml_limit | ON