You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have set up a MySQL database using systemctl start mysql and it all works. The host and port are "localhost" and 3306 respectively with username "root".
I have filled these credentials in the config.py file as well and changed the engine parameter to mysql.
Firstly I think the docstring for those functions are not updated because it calls for renaming of variables that are no longer present, but from what I figured the name under the DbConfig class refers to the database name.
Given all these, I am still unable to connect to the server. The following seem to be the issue:
The create_engine() command is not working because the interpreter never crosses that line of code (found through debug statements).
The database name passed to the mysql server is .data/nettacker.db which is invalid for MySQL databases and only works for SQLite. So the command CREATE DATABASE path/to/.data/nettacker.db gives an error.
The default config for DbConfig class is sqlite and that requires the nettacker.db file which is why the product works if no one tries to change the DbConfig.
Proposed solution:
Update the docstring for the DbConfig class
Use pymysql as a bridge to allow direct SQL connections and queries in the mysql.py file
Update the db.py file to allow both MySQL and SQLite
Increase the max connections for the server (user/admin has to do this)
I have tried these locally and they seem to work well. Let me know if you want me to push these changes for you to review.
The text was updated successfully, but these errors were encountered:
I have set up a MySQL database using
systemctl start mysql
and it all works. The host and port are "localhost" and 3306 respectively with username "root".I have filled these credentials in the
config.py
file as well and changed theengine
parameter tomysql
.Firstly I think the docstring for those functions are not updated because it calls for renaming of variables that are no longer present, but from what I figured the
name
under theDbConfig
class refers to the database name.Given all these, I am still unable to connect to the server. The following seem to be the issue:
.data/nettacker.db
which is invalid for MySQL databases and only works for SQLite. So the command CREATE DATABASE path/to/.data/nettacker.db gives an error.The default config for DbConfig class is sqlite and that requires the nettacker.db file which is why the product works if no one tries to change the DbConfig.
Proposed solution:
mysql.py
filedb.py
file to allow both MySQL and SQLiteI have tried these locally and they seem to work well. Let me know if you want me to push these changes for you to review.
The text was updated successfully, but these errors were encountered: