How to use Mysql Database in viper?
loossy opened this issue · comments
loossy commented
I installed Mysql 5.7.26.
And, created Mysql account.
Then, I modified viper.conf
[database]
# Configure the database connection type example shown below
# Examples:
# sqlite:///foo.db
# postgresql://foo:bar@localhost:5432/mydatabase
# mysql://foo:bar@localhost/mydatabase
# mysql+pymysql://foo:bar@localhost/mydatabase
# If empty, default is a SQLite in $storage_path/viper.db
connection= mysql://[my_account]:[my_account_password]@x.x.x.x/[database_name]
Then, I executed viper-cli.
showed this mesaage to me.
Traceback (most recent call last):
File "./viper-cli", line 8, in <module>
from viper.core.ui import console
File "/home/vault/viper/viper/core/ui/console.py", line 19, in <module>
from viper.core.plugins import __modules__
File "/home/vault/viper/viper/core/plugins.py", line 81, in <module>
__modules__ = load_modules()
File "/home/vault/viper/viper/core/plugins.py", line 75, in load_modules
parser_args=get_argparse_parser_actions(member_object().parser),
File "/home/vault/viper/viper/modules/clamav.py", line 28, in __init__
self.db = Database()
File "/home/vault/viper/viper/core/database.py", line 204, in __init__
Base.metadata.create_all(self.engine)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/sql/schema.py", line 4287, in create_all
ddl.SchemaGenerator, self, checkfirst=checkfirst, tables=tables
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 2032, in _run_visitor
with self._optional_conn_ctx_manager(connection) as conn:
File "/usr/lib/python3.6/contextlib.py", line 81, in __enter__
return next(self.gen)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 2024, in _optional_conn_ctx_manager
with self._contextual_connect() as conn:
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 2226, in _contextual_connect
self._wrap_pool_connect(self.pool.connect, None),
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/base.py", line 2262, in _wrap_pool_connect
return fn()
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/pool/base.py", line 363, in connect
return _ConnectionFairy._checkout(self)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/pool/base.py", line 760, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/pool/base.py", line 492, in checkout
rec = pool._do_get()
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/pool/impl.py", line 139, in _do_get
self._dec_overflow()
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
compat.reraise(exc_type, exc_value, exc_tb)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/util/compat.py", line 129, in reraise
raise value
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/pool/impl.py", line 136, in _do_get
return self._create_connection()
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/pool/base.py", line 308, in _create_connection
return _ConnectionRecord(self)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/pool/base.py", line 437, in __init__
self.__connect(first_connect_check=True)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/pool/base.py", line 639, in __connect
connection = pool._invoke_creator(self)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "/usr/local/lib/python3.6/dist-packages/sqlalchemy/engine/default.py", line 453, in connect
return self.dbapi.connect(*cargs, **cparams)
File "/home/vault/.local/lib/python3.6/site-packages/MySQLdb/__init__.py", line 84, in Connect
return Connection(*args, **kwargs)
File "/home/vault/.local/lib/python3.6/site-packages/MySQLdb/connections.py", line 164, in __init__
super(Connection, self).__init__(*args, **kwargs2)
TypeError: 'check_same_thread' is an invalid keyword argument for this function
Continuously, showed python error that related Mysql.
Database Table was empty, too.
Which Configure settings should be added?