win10 wsl 安装 Inception

TOC


https://github.com/cookieY/inception-document/blob/master/docs/install.md

1. 启用wsl并安装ubuntu 16.04

  1. win10 设置 -- 更新和安全 -- 开发者选项 -- 开发人员模式
  2. 控制面板 -- 程序 -- 启用或者关闭windows功能 -- 适用于Linux的Windows子系统
  3. Microsoft Store -- Ubuntu 16.04 , 不要安装18.04 安装出现问题,安装ubuntu ,设置用户名密码
    或者通过这个链接唤醒进入store,安装ubuntu16 https://www.microsoft.com/zh-cn/p/ubuntu-1604-lts/9pjn388hp8c9?activetab=pivot%3Aoverviewtab
  4. cmd -- bash -- 进入ubuntu

2. Ubuntu apt换源

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo vim /etc/apt/sources.list

#deb包
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  
##测试版源  
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  
# 源码  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse  
##测试版源  
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse  

sudo apt-get update

3. 安装Inception

ubuntu16安装,不要选择ubuntu18
此时可以先不装mysql,pt,

#1. 依赖 
sudo apt-get install cmake libncurses5-dev libssl-dev g++ m4 perl
#2. 安装bison,官方建议2.6版本之前,2.5.1/2.4 都可以,2.3不行
mkdir ~/program ; cd ~/program 
wget -c https://static.saintic.com/download/inception/bison-2.5.1.tar && tar -xf bison-2.5.1.tar  cd bison-2.5.1 
./configure && sudo make && sudo make install
#3. 安装inception  
git clone , cd Inception ,
sh inception_build.sh debug     #后面的平台是可选的,如果不指定就是linux平台


#或者直接cmake
cmake -DWITH_DEBUG=OFF -DCMAKE_INSTALL_PREFIX=/Inception -DMYSQL_DATADIR=/Inception/data -DWITH_SSL=bundled -DCMAKE_BUILD_TYPE=RELEASE -DWITH_ZLIB=bundled -DMY_MAINTAINER_CXX_WARNINGS="-Wall -Wextra -Wunused -Wno-dev -Wwrite-strings -Wno-strict-aliasing -Wno-unused-parameter -Woverloaded-virtual" -DMY_MAINTAINER_C_WARNINGS="-Wall -Wextra -Wno-dev -Wunused -Wwrite-strings -Wno-strict-aliasing -Wdeclaration-after-statement" && make && make install


#macos 的话, 安装xcode ,macos 系统版本太低,比如10.12 , Apple store 最新的xcode 不能下载,在developer.apple.com下载xcode8 , 解压,安装。 
inception_build.sh debug [Xcode]

4. 启动

sudo vim /etc/inc.cnf 
chown -R 777 /usr/local/inception/        #socket目录创建和权限
sudo chown -R 777 /usr/local/inception/
cd debug/mysql/bin/
sudo ./Inception --defaults-file=/etc/inc.cnf &
./mysql -uroot -h127.0.0.1 -P6669        #登录
inception get variables;                #查看variables

5. 参数解释

[inception]
general_log=1
general_log_file=/var/log/inception.log
#这个参数实际上就是MySQL数据库原来的参数,因为Incpetion没有权限验证过程,那么为了实现更安全的访问,可以给Inception服务器的这个参数设置某台机器(Inception上层的应用程序)不地址,这样
#其它非法程序是不可访问的,那么再加上Inception执行的选项中的用户名密码,对MySQL就更加安全
bind_address=$bind_address
port=$port
socket=/var/run/inception.socket
character-set-client-handshake=0
character-set-server=utf8

#备份相关
#需要开启binlog
inception_remote_system_password=$inception_remote_system_password
inception_remote_system_user=$inception_remote_system_user
inception_remote_backup_port=$inception_remote_backup_port
inception_remote_backup_host=$inception_remote_backup_host

#在DML语句中没有WHERE条件时,是不是要报错
inception_check_dml_where=1
#在DML语句中使用了LIMIT时,是不是要报错
inception_check_dml_limit=1
#在DML语句中使用了Order By时,是不是要报错
inception_check_dml_orderby=1
#Select*时是不是要报错
inception_enable_select_star=1
#order by rand时是不是报错
inception_enable_orderby_rand=1
#创建或者新增列时如果列为NULL,是不是报错
inception_enable_nullable=1
#是不是支持外键
inception_enable_foreign_key=1
#一个索引中,列的最大个数,超过这个数目则报错(1-64)
inception_max_key_parts=5
#在一个修改语句中,预计影响的最大行数,超过这个数就报错(1-max)
inception_max_update_rows=10000
#一个表中,最大的索引数目,超过这个数则报错(1-1024)
inception_max_keys=16
#建表指定的存储引擎不为Innodb,不报错
inception_enable_not_innodb=0
#表示在建表或者建库时支持的字符集,如果需要多个,则用逗号分隔,影响的范围是建表、设置会话字符集、修改表字符集属性等
inception_support_charset=$inception_support_charset
#建表时,表没有注释时报错
inception_check_table_comment=1
#建表时,列没有注释时报错
inception_check_column_comment=1
#建表时,如果没有主键,则报错
inception_check_primary_key=1
#是不是支持分区表
inception_enable_partition_table=0
#是不是支持enum,set,bit数据类型
inception_enable_enum_set_bit=0
#是不是要检查索引名字前缀为"idx_",检查唯一索引前缀是不是"uniq_"
inception_check_index_prefix=1
#自增列是不是要为无符号型
inception_enable_autoincrement_unsigned=1
#当char类型的长度大于这个值时,就提示将其转换为VARCHAR(1-max)
inception_max_char_length=16
#当建表时自增列的值指定的不为1,则报错
inception_check_autoincrement_init_value=1
#当建表时自增列的类型不为int或者bigint时报错
inception_check_autoincrement_datatype=1
#建表时,如果没有为timestamp类型指定默认值,则报错
inception_check_timestamp_default=0
#允许列自己设置字符集
inception_enable_column_charset=0
#建表时,如果指定的自增列的名字不为ID,则报错,说明是有意义的,给提示
inception_check_autoincrement_name=1
#在多个改同一个表的语句出现时,报错,提示合成一个
inception_merge_alter_table=1
#检查在建表、修改列、新增列时,新的列属性是不是要有默认值
inception_check_column_default_value=1
#检查是不是支持BLOB字段,包括建表、修改列、新增列操作
inception_enable_blob_type=1
#检查在SQL语句中,是不是有标识符被写成MySQL的关键字,默认值为报警。
inception_enable_identifer_keyword=1
#这个参数的作用是为了匹配Python客户端每次自动设置auto_commit=0的,如果取消则会报错,针对Inception本身没有实际意义
#auto_commit=0

#打开与关闭Inception对SQL语句中各种名字的检查,如果设置为ON,则如果发现名字中存在除数字字母下划线之外的字符时,报Identifier "invalidname" is invalid, valid options: [a-z,A-Z,0-9,_].
inception_check_identifier=1

#开启对OSC的支持
inception_osc_on=$inception_osc_on
inception_osc_bin_dir=/usr/local/bin/pt-online-schema-change




猜你喜欢

转载自www.cnblogs.com/jesper/p/10847282.html