Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install mysql audit platform yearning and inception

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to install mysql audit platform yearning and inception, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

# rough documents

# installation directory is under / usr/local

# the yearning installation package is too big to store, so I put it in my 126mailbox.

Nginx installation

Yum install nginx-y

Inception installation

Yum-y install cmake libncurses5-dev libssl-dev gathers + bison gcc gcc-c++ openssl-devel ncurses-devel mysql MySQL-python

Wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz

Tar-zxvf bison-2.5.1.tar.gz

Cd bison-2.5.1

. / configure

Make

Make install

Cd / usr/local/

Wget https://github.com/myide/inception/archive/master.zip

Unzip master.zip

Cd inception-master/

Sh inception_build.sh builddir linux

Start the service

Nohup / usr/local/inception-master/builddir/mysql/bin/Inception-- defaults-file=/etc/inc.cnf &

Log in to inception

Mysql-uroot-h227.0.0.1-P6669

Test whether inception is installed successfully

Inception get variables

Install python 3.6

Wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz

Tar-xvf Python-3.6.4.tar.xz

Mkdir-p / usr/local/python/3.6.4/lib

Cd Python-3.6.4

. / configure-- enable-shared-- prefix=/usr/local/python/3.6.4 LDFLAGS= "- Wl,-rpath / usr/local/python/3.6.4/lib"

Make

Make install

Cp / usr/bin/python / usr/bin/python2.6.6

Ln-fs / usr/local/python/3.6.4/bin/python3.6 / usr/bin/python

Ln-fs / usr/local/python/3.6.4/bin/pip3 / usr/bin/pip

Vi / usr/bin/yum

Change the header #! / usr/bin/python to #! / usr/bin/python2.6.6

Yearning installation

Go to mysql and execute the database building statement to create the library Yearning

Create database Yearning DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci

Install this version of the package

Yearning-1.1.2-release.tar.gz (temporarily stored under 152environment / usr/local/)

# the yearning installation package is too big to store, so I put it in my 126mailbox.

Do not use the latest version the following command downloads the latest package (requires docker installation not applicable)

Git clone https://github.com/cookieY/Yearning.git

Cd Yearning/src

Pip install-r requirements.txt

Python manage.py makemigrations

Python manage.py migrate

Add initialization user

Echo "from core.models import Account;Account.objects.create_user (username='admin', password='Yearning_admin', group='admin',is_staff=1)" | python manage.py shell # add initialization user

Echo "from core.models import grained Grained.objects.get_or_create (username='admin', permissions= {'person': [],' ddl':'1, 'ddlcon': [],' dml':'1, 'dmlcon': [],' dic':'1), 'diccon': [],' dicedit':'0, 'user':' 1, 'base':' 1, 'dicexport':' 0, 'query':' 1' 'querycon': []}) "| python manage.py shell # initialization permissions

-the next one may not work. You can ignore it. It's okay.

Echo "from core.models import globalpermissions Globalpermissions.objects.get_or_create (authorization='global', inception= {'host':', 'port':', 'user':', 'password':', 'back_host':', 'back_port':', 'back_user':', 'back_password':'}, ldap= {'type':', 'host':', 'sc':'' 'domain':', 'user':', 'password':'}, message= {'webhook':', 'smtp_host':', 'smtp_port':', 'user':', 'password':', 'to_user':', 'mail': False,' ding': False}, other= {'limit':', 'con_room': [' AWS', 'Aliyun' 'Own',' Other'], 'foce':', 'multi': False,' query': False, 'sensitive_list': [],' sensitive':'}) "| python manage.py shell # initializes dynamic configuration information

Cd Yearning/webpage/dist

Cp-rf * / usr/share/nginx/html/

Service nginx restart

Cd Yearning/src

Python manage.py runserver 0.0.0.0:8000

-

Here are some possible mistakes

The following errors may occur

Network connection https://blog.csdn.net/zoulonglong/article/details/79552813

Python3.6 error: ModuleNotFoundError:No module named "Crypto"

Reasons and treatment:

Import, a third-party library, is often used when using python, but sometimes it prompts that a module does not exist, such as Crypto

Actually, it's because the name of this module in Python3 has changed.

Pip install pycrypto, try.

After the installation is successful, if you are prompted that the module is not available, check the python3 installation directory Lib--site-package to see if there is a Crypto folder. You should see that there is a crypto folder and rename it to Crypto.

If there is another prompt that there is no Crypto.Cipher, "ModuleNotFoundError:No module named 'Crypto.Cipher'", then go to the Crypto folder to see if there is a Cipher folder, and you will find, hey, it doesn't exist, look at step 4

At this point, you need to uninstall pycrypto,pip uninstall pycrypto and then install pycryptodome,pip install pycryptodome.

The following errors may occur

Network connection https://blog.csdn.net/dearmark/article/details/78208051

ValueError: invalid literal for int () with base 10: 'Inception2'

The reasons are as follows

Since Inception does not support pymysql natively, you need to change the source code related to pymysql. Note: connections.py and cursors.py that have been modified under the install folder can be replaced directly.

Connections.py

Cursors.py

Find pymysql source code to modify connections.py file

Find 1107 lines

Def _ request_authentication (self):

# https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse

If int (self.server_version.split ('.', 1) [0]) > = 5:

Self.client_flag | = CLIENT.MULTI_RESULTS

Modify to

Def _ request_authentication (self):

# https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::HandshakeResponse

Try:

If int (self.server_version.split ('.', 1) [0]) > = 5:

Self.client_flag | = CLIENT.MULTI_RESULTS

Except:

If self.server_version.split ('.', 1) [0] = 'Inception2':

Self.client_flag | = CLIENT.MULTI_RESULTS

Find pymysql source code to modify cursors.py file

Find line 346

If self._result and (self._result.has_next or not self._result.warning_count):

Return

Modify to

If self._result:

Return

The above is all the contents of the article "how to install mysql Audit platform yearning and inception". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report