Closed nierardi closed 6 years ago
It's very unlikely that CTFd is failing to use the provided config because this code hasn't changed in a long time and it's worked for myself and others.
Have you installed all dependencies? Can you perhaps try this with a new less privileged user? I have seen issues wehre MySQL is unhappy with people using root to connect to the database.
I've installed requirements.txt already. All dependencies are satisfied.
I just made a new user "ctfd" and granted it appropriate privileges, changed it in the config, and I am getting the same error message. Any ideas why?
EDIT reinstalling did not appear to fix the problem
ANOTHER EDIT the url object created in create_app() does contain the specified username and password, as expected: <<< DEBUG >>> url username: root url password: ctfdctfd
I have downgraded MySQL to 5.7.21 and it will now authenticate properly.
Are other users able to authenticate their databases when using MySQL 8?
Environment:
What happened?
It appears that the config.py is blatantly ignoring the MySQL password I enter. I'm using gunicorn to run CTFd.
Here is my SQLALCHEMY_DATABASE_URI config value:
SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:ctfdctfd@localhost/ctfd'
note: this is just a temporary passwordI have consulted the
create_engine()
statement example from http://docs.sqlalchemy.org/en/latest/dialects/mysql.html#transaction-isolation-level, as well as http://flask-sqlalchemy.pocoo.org/2.1/config/#configuration-keys. The format should bemysql+pymysql://<user>:<password>@<ip>/<database>
.On startup, I get this error as the very last line, before it stops:
OperationalError: (pymysql.err.OperationalError) (1045, u"Access denied for user 'root'@'localhost' (using password: NO)") (Background on this error at: http://sqlalche.me/e/e3q8)
The only way I can run CTFd is with an unsecured database, with no password at all. I cannot use CTFd in a production environment with no database security.
What did you expect to happen?
No error, startup as normal.
How to reproduce your issue
Any associated stack traces or error logs
Entire console output from server start to stop: