Inception successful instance sharing Installation
Inception is an automated O & M system integrating audit SQL, execution SQL, and rollback.
# Ssh 192.168.163.128 // my Testing Machine
Download Inception
# Mkdir-p/songlisha/inception
# Cd/songlisha/inception
# Wget https://github.com/mysql-inception/inception/archive/master.zip
Install Inception
# Unzip master.zip
# Mkdir inception data // create the inception installation directory and data Directory
# Cd inception-master
# Cmake-DWITH_DEBUG = OFF-limit =/songlisha/inception-Limit =/songlisha/inception/data-DWITH_SSL = yes-DCMAKE_BUILD_TYPE = RELEASE-DWITH_ZLIB = bundled-Limit =" -Wall-Wextra-Wunused-Wwrite-strings-Wno-strict-aliasing-Wno-unused-parameter-Woverloaded-virtual "-layout ="-Wall-Wextra-Wunused-Wwrite- strings-Wno-strict-aliasing-Wdeclaration-after-statement"
An error occurred while compiling! As shown in:
Solution (the module required for inception installation ):
# Yum-y install cmake libncurses5-dev libssl-dev g ++ bison openssl-devel.x86_64
# Sh-x inception_build.sh debug
# Sh inception_build.sh debug [linux]
The following error is reported:
Solution:
# Make-j6 & make install
After installation, add the configuration file:
# Vim/songlisha/inception/inc. cnf
[Inception]
General_log = 1
General_log_file =/songlisha/inception/data/inception. log
Port = 6669
Socket =/songlisha/inception/inc. socket
Character-set-client-handshake = 0
Character-set-server = utf8
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 = 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 =/songlisha/inception/data/temp
Inception_osc_chunk_time = 0.1
Inception_ddl_support = 1
Inception_enable_blob_type = 1
Inception_check_column_default_value = 1
# Mkdir-p/songlisha/inception/data/temp // create a directory not found in the configuration file
Start Inception.
Now the start time is up, there are two ways to start, the same as MySQL
1. Start the configuration file.
#/Songlisha/inception/bin/Inception -- defaults-file =/songlisha/inception/inc. cnf
2. Start the port.
#/Songlisha/inception/bin/Inception -- port = 6669
The first method is successfully started.
Test Inception
# Mysql-uroot-h127.0.0.1-P6669
Mysql> inception get variables; // lists all parameters. The startup is successful!
Install pip // pip similar to yum in RedHat, which is very convenient to install Python packages.
# Cd/songlisha/inception
# Wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" -- no-check-certificate
# Tar zxvf pip-1.5.4.tar.gz
# Cd pip-1.5.4
# Python setup. py install
Install the dependency module first
# Pip install flask_wtf
# Pip install flask-script
# Pip install flask-debugtoolbar
# Pip install MySQL-python
The following error is reported:
Error: command 'gcc 'failed with exit status 1
Cleaning up...
Command/usr/bin/python-c "import setuptools, tokenize ;__ file __= '/tmp/pip_build_root/MySQL-python/setup. py'; exec (compile (getattr (tokenize, 'open', open) (_ file __). read (). replace ('\ r \ n',' \ n'), _ file __, 'exec ')) "install -- record/tmp/pip-lhP9WW-record/install-record.txt -- single-version-externally-managed -- compile failed with error code 1 in/tmp/pip_build_root/MySQL-python
Traceback (most recent call last ):
File "/usr/bin/pip", line 9, in <module>
Load_entry_point ('pip = 1.5.4 ', 'console _ scripts', 'pip ')()
File "/usr/lib/python2.6/site-packages/pip-1.5.4-py2.6.egg/pip/_ init _. py", line 185, in main
Return command. main (cmd_args)
File "/usr/lib/python2.6/site-packages/pip-1.5.4-py2.6.egg/pip/basecommand. py", line 161, in main
Text = '\ n'. join (complete_log)
UnicodeDecodeError: 'ascii 'codec can't decode byte 0xe2 in position 33: ordinal not in range (128)
Solution:
# Yum install gcc libffi-devel python-devel openssl-devel-y
# Pip install MySQL-python // the installation is successful again!
Install git
# Yum-y install git
Install inception_web
# Git clone https://github.com/dbalihui/inception_web.git
# Cd/songlisha/inception/inception_web/app
# Cat inception. py // modify the user name and password in the configuration file
# Coding = UTF-8
Import MySQLdb
Def table_structure (mysql_structure ):
Sql1 = '/* -- user = root; -- password = root; -- host = 127.0.0.1; -- execute = 1; -- port = 3306 ;*/\
Inception_magic_start ;\
Use songlisha; '// change the database name here
Sql2 = 'ception _ magic_commit ;'
SQL = sql1 + mysql_structure + sql2
Try:
Conn = MySQLdb. connect (host = '2017. 0.0.1 ', user = 'root', passwd = 'root', db = 'songlisha', port = 6669, use_unicode = True, charset = "utf8 ")
Cur = conn. cursor ()
Ret‑cur.exe cute (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 ()
Counter t MySQLdb. Error, e:
Print "Mysql Error % d: % s" % (e. args [0], e. args [1])
Return result [1] [4]. split ("\ n ")
# Cd/songlisha/inception/inception_web/
#./Run. py runserver -- host 127.0.0.1
The following error is reported:
/Songlisha/inception/inception_web/app/_ init _. py: 7: ExtDeprecationWarning: Importing flask. ext. script is deprecated, use flask_script instead.
From flask. ext. script import Manager
Traceback (most recent call last ):
File "./run. py", line 7, in <module>
From app import app, manager
File "/songlisha/inception/inception_web/app/_ init _. py", line 7, in <module>
From flask. ext. script import Manager
File "/usr/lib/python2.6/site-packages/flask/exthook. py", line 96, in load_module
Reraise (exc_type, exc_value, tb. tb_next)
File "/usr/lib/python2.6/site-packages/flask_script/_ init _. py", line 11, in <module>
Import argparse
ImportError: No module named argparse // The argparse module is missing
Solution:
# Easy_install argparse // install this module
Again
#./Run. py runserver -- host 127.0.0.1
Again:
ImportError: libmysqlclient. so.18: cannot open shared object file: No such file or directory
Solution:
# Ln-s/usr/local/mysql/lib/libmysqlclient. so.18/usr/lib64/libmysqlclient. so.18
#./Run. py runserver -- host 127.0.0.1 // execution successful! But it cannot be accessed from a browser.
#./Run. py runserver -- host 192.168.163.128 // The local IP address must be used for browser access.
Access my page in a browser
Http: // 192.168.163.128: 5000/
However: #./run. py runserver -- host 192.168.163.128
Once this command exits, my browser will not be able to access it! 404
Screen-S server _ name: create a window manager
Ctrl + a + c create a window
Ctrl + a + n switch to the next window
Ctrl + a + d minimize window manager
Screen-dr server_name reopen Window Manager
Screen-ls: List window managers