码迷,mamicode.com
首页 > 其他好文 > 详细

inception安装

时间:2018-06-20 00:08:45      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:err   目录   efault   column   gic   TE   enable   evel   lin   

  1. documentation
  2. installation
  • compile install bison

    cd /usr/local/src
    wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz
    cd bison-2.5.1/
    ./configure
    make && make install
  • compile install inception

    cd /usr/local/src
    git clone https://github.com/mysql-inception/inception.git
    cd inception/
    sh inception_build.sh debug     // ignore [Xcode] defualt linux env
  • inc.cnf path & content

    /usr/local/src/inception/debug/mysql/bin/inc.cnf 
    [inception]
    general_log=1
    general_log_file=inception.log
    port=6669
    socket=/自己目录,请自行修改/inc.socket
    character-set-client-handshake=0
    character-set-server=utf8
    inception_remote_system_password=root
    inception_remote_system_user=wzf1
    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
  • start inception

    nohup /usr/local/src/inception/debug/mysql/bin/Inception --defaults-file=inc.cnf &
  • check inception

    mysql -uroot -h127.0.0.1 -P6669
    inception get variables;        //there are some output if all correct 
  1. python interface exam

    apt-get install python-mysqldb      //ubuntu os
  • vim whateveryoulike.py on /wherever/you/like/whateveryoulike.py

    vim whateveryoulike.py
    #!/usr/bin/python
    #-\*-coding: utf-8-\*-
    import MySQLdb
    sql=‘/*--user=username;--password=password;--host=127.0.0.1;--execute=1;--port=3306;*/inception_magic_start;use mysql;CREATE TABLE adaptive_office(id int);inception_magic_commit;‘
    try:
    conn=MySQLdb.connect(host=‘127.0.0.1‘,user=‘‘,passwd=‘‘,db=‘‘,port=9998)
    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])
  • execute whateveryoulike.py

    python  whateveryoulike.py
    [‘ID‘, ‘stage‘, ‘errlevel‘, ‘stagestatus‘, ‘errormessage‘, ‘SQL‘, ‘Affected_rows‘, 
    ‘sequence‘, ‘backup_dbname‘, ‘execute_time‘, ‘sqlsha1‘]  
    1 | CHECKED | 0 | Audit completed | None | use mysql | 0 | ‘0_0_0‘ | None |     0  |
    2 | CHECKED | 1 | Audit completed | 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‘. | CREATE TABLE adaptive_office(id int) 
    | 0 | ‘0_0_1‘ | 127_0_0_1_3306_mysql |     0|

inception安装

标签:err   目录   efault   column   gic   TE   enable   evel   lin   

原文地址:https://www.cnblogs.com/vickey-wu/p/9201582.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!