Cuckoo Database Changes

Source: Internet
Author: User
Tags sqlite import database

1, cuckoo version upgrade

Cuckoo default database is SQLite, the default connection mode is Sqlite:///os.path.join (Report_root, "db", "cuckoo.db")

Upgrading the cuckoo version requires upgrading the database version, each cuckoo version of the database has the corresponding field changes, each cuckoo version of the database has a corresponding

Schema_version, defined in lib/cuckoo/core/database.py, so the upgrade cuckoo first need to update the database content (mainly some field changes and table content updates), method: CD utils/db_ migration/&& Alembic Upgrade head

2. Database changes

By looking at the cuckoo.conf configuration file, Cuckoo currently supports three forms of database SQLite, PostgreSQL, MySQL

The database is judged in cuckoo, and if the number of virtual machines is greater than 1 and the database type is SQLite, there may be some problems with parallel processing tasks

2.1. Switch MySQL

1. Install MySQL (skip)

2. Create a Cuckoo database

Mysql–uroot–ppassword into MySQL database

Create Database cuckoo; Database path in/polydata/data/db/mysql

3. Modify the configuration file

Cuckoo.conf->database->connection = Mysql://root:[email Protected]/cuckoo

4. Installing the MYSQLDB module

sudo apt-get install Python-mysqldb

Python interactive command can be successfully installed if import MYSQLDB is available

Import database-driven issues are reported if no installation or installation fails

Raise Cuckoodependencyerror ("Missing database driver, unable to import%s (install with ' pip install%s ')"% (Lib, Lib))

5, solve the problem can not be through MySQL. Sock connection to MySQL

Symptom: Can ' t connect to local MySQL server through socket '/tmp/mysql.sock ' (2)

Workaround: Ln-s/var/run/mysqld/mysqld.sock/tmp/mysql.sock

reference:http://blog.csdn.net/ixidof/article/details/5958904

At this point cuckoo can use MySQL database, if there is cuckoodatabaseerror, that is

"DB schema version Mismatch:found {0}, expected {1}."
"Try to apply all migrations (CD utils/db_migration/&&"
"Alembic upgrade head)." Format (Last.version_num, schema_version))
Cause: There will be a field in the database alembic_version, where the version_num is defined schema_version, through this content to determine the different cuckoo version, if the installation of a high version of Cuckoo, Now you want to use the lower version of Cuckoo, you can only delete the database or change the database directly Version_num
2.2. Toggle PostgreSQL


Cuckoo Database Changes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.