Centos7.4 安装 Inception

本文涉及的产品
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介:

Cetos7.4系统  环境设置

1
2
yum  install  cmake   ncurses-devel gcc gcc-c++  openssl-devel
yum  remove bison -y


1
2
3
4
5
6
7
8
9
10
11
12
cd  /usr/local/src/
wget http: //ftp .gnu.org /gnu/m4/m4-1 .4.18. tar .gz
tar  -zxvf m4-1.4.18. tar .gz
cd  m4-1.4.18
. /configure  &&  make  &&  make  install
 
 
 
wget  http: //ftp .gnu.org /gnu/bison/bison-2 .4. tar .gz
tar  -zxvf bison-2.4. tar .gz
cd  bison-2.4/
. /configure





1
2
3
4
5
6
7
cd  /usr/local/
wget https: //github .com /mysql-inception/inception/archive/master .zip
unzip master.zip
mv  inception-master/  inception
mv  master.zip inception.zip
mv  inception.zip    /usr/local/src/
sh inception_build.sh builddir  linux



配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
vim   inc.cnf
[inception]
general_log=1
general_log_file=inception. log
port=6669
socket=/tmp/mysql.sock
character-set-client-handshake=0
character-set-server=utf8
inception_remote_system_password=root
inception_remote_system_user=123456
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_enable_blob_type=1
inception_check_column_default_value=1


启动测试

1
2
3
4
5
6
nohup     /usr/local/inception/builddir/mysql/bin/Inception   --defaults- file =inc.cnf   > /dev/null   2>&1   &
 
 
mysql -uroot -h127.0.0.1 -P6669
 
inception get variables;


安装测试完成。


python3  

由于python3使用的pymysql模块里并未兼容inception返回的server信息,因此需要编辑/path/to/python3/lib/python3.4/site-packages/pymysql/connections.py:

在if int(self.server_version.split('.', 1)[0]) >= 5: 这一行之前加上以下这一句并保存,记得别用tab键用4个空格缩进:

self.server_version = '5.6.24-72.2-log'

pymysql.png

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#/usr/bin/python
#_*_ coding:utf-8  _*_
import  pymysql.cursors
sql='/*--user=root;--password=123456;--host=192.168.10.81;--execute=1;--port=3306;*/\
inception_magic_start;\
use hequan;\
CREATE TABLE adaptive_office( id  int);\
inception_magic_commit;'
try:
     conn=pymysql.connect(host= '127.0.0.1' ,user= '' , passwd = '' ,db= '' ,port=6669)
     cursor=conn.cursor()
     cursor.execute(sql)
     results = cursor.fetchall()
     column_name_max_size=max(len(i[0])  for  in  cursor.description)
     row_num=0
     for  result  in  results:
         row_num=row_num+1
         print( '*' .ljust(27, '*' ),row_num, '.row' '*' .ljust(27, '*' ))
         row = map(lambda x, y: (x,y), (i[0]  for  in  cursor.description), result)
         for  each_column  in  row:
             if  each_column[0] !=  'errormessage' :
                 print(each_column[0].rjust(column_name_max_size), ":" ,each_column[1])
             else :   
                 print(each_column[0].rjust(column_name_max_size), ':' ,each_column[1].replace( '\n' , '\n' .ljust(column_name_max_size+4)))
     cursor.close()
     conn.close()
except pymysql.Error as e:
      print( "Mysql Error %d: %s"  % (e.args[0], e.args[1]))


*************************** 1 .row ***************************

           ID : 1

        stage : CHECKED

     errlevel : 0

  stagestatus : Audit completed

errormessage : None

          SQL : use hequan

Affected_rows : 0

     sequence : '0_0_0'

backup_dbname : None

execute_time : 0

      sqlsha1 :

*************************** 2 .row ***************************

           ID : 2

        stage : CHECKED

     errlevel : 2

  stagestatus : Audit completed

errormessage : Table 'adaptive_office' already exists.

                Set engine to innodb for table 'adaptive_office'.

                Set charset to one of 'utf8mb4' for table 'adaptive_office'.

                Set comments for table 'adaptive_office'.

                Column 'id' in table 'adaptive_office' have no comments.

                Column 'id' in table 'adaptive_office' is not allowed to been nullable.

                Set Default value for column 'id' in table 'adaptive_office'

                Set a primary key for table 'adaptive_office'.

          SQL : CREATE TABLE adaptive_office(id int)

Affected_rows : 0

     sequence : '0_0_1'

backup_dbname : 192_168_10_81_3306_hequan

execute_time : 0

      sqlsha1 :










本文转自 295631788 51CTO博客,原文链接:http://blog.51cto.com/hequan/2052602,如需转载请自行联系原作者
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
3天前
|
前端开发 jenkins 持续交付
新的centos7.9安装docker版本的jenkins2.436.1最新版本-前端项目发布(五)
新的centos7.9安装docker版本的jenkins2.436.1最新版本-前端项目发布(五)
13 1
|
3天前
|
jenkins 网络安全 持续交付
新的centos7.9安装docker版本的jenkins2.436.1最新版本-后端项目发布(四)
新的centos7.9安装docker版本的jenkins2.436.1最新版本-后端项目发布(四)
12 3
|
4天前
|
网络协议 Linux Docker
在centos7下通过docker 安装onlyoffice
在centos7下通过docker 安装onlyoffice
16 0
|
1天前
|
运维 Kubernetes 监控
本地CentOS安装轻量级容器PaaS平台KubeSphere并实现无公网IP远程访问
本地CentOS安装轻量级容器PaaS平台KubeSphere并实现无公网IP远程访问
3 0
|
3天前
|
Kubernetes Docker 容器
Docker 安装 Portainer
Portainer Community Edition是一个针对容器化应用程序的轻量级服务交付平台,可用于管理 Docker、Swarm、Kubernetes 和 ACI 环境。它的设计理念是部署和使用都简单,该应用程序允许您通过“智能”GUI 和/或广泛的 API 管理所有编排器资源。
35 3
|
3天前
|
Java 开发工具 git
新的centos7.9安装docker版本的jenkins2.436.1最新版本-项目发布(三)
新的centos7.9安装docker版本的jenkins2.436.1最新版本-项目发布(三)
11 4
|
3天前
|
Oracle jenkins 持续交付
新的centos7.9安装jenkins(二)
新的centos7.9安装jenkins(二)
|
3天前
|
jenkins Java 持续交付
新的centos7.9安装jenkins—(一)
新的centos7.9安装jenkins—(一)
10 0
|
3天前
|
网络安全 Docker 容器
测试开发环境下centos7.9下安装docker的minio
测试开发环境下centos7.9下安装docker的minio
|
4天前
|
Linux Apache
Centos7 安装Apache
安装Apache的步骤
23 6