zoukankan      html  css  js  c++  java
  • inception安装

    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|
    
  • 相关阅读:
    Mac电脑maven安装与配置
    解决Mac OS X中IDEA启动慢以及debug卡死问题
    如何在Mac上启用root用户或更改root密码
    mac文本编辑器软件,五大适用于Mac修订的文本编辑器,nodepad++替代软件
    mac系统到10.14以上,navicat无法打开,一直显示已损坏解决办法
    mac苹果电脑AppleID注册或者登录appstore时提示:您没有完整填写表格,请输入您的出生年份的解决方法
    mac苹果电脑使用相关,开发环境配置指南(持续更新)
    bitmap to base64
    Multiple actions were found that match the request in Web Api
    vue get attribute value
  • 原文地址:https://www.cnblogs.com/vickey-wu/p/9201582.html
Copyright © 2011-2022 走看看