teeworlds-infclass icon indicating copy to clipboard operation
teeworlds-infclass copied to clipboard

Building with mysql is hard

Open bretonium opened this issue 6 years ago • 2 comments

Today i have spent a lot of time trying to build infclass with mysql support. Even though the build succeeded, i always got this error when launched sql_server_d:

[5bcb4203][sql]: MySQL Error: Access denied for user 'breton'@'localhost'
[5bcb4203][sql]: ERROR: sql connection failed
[5bcb4203][sql]: Warning: Unable to connect to SqlWriteServer 0 ('127.0.0.1'), trying next...
[5bcb4203][sql]: FATAL ERROR: No SqlWriteServers available

I got this error even though i used another user for mysql credentials.

Turns out, i needed to install development libraries to my system: apt install libmariadbclient-dev libmysqlcppconn-dev. I also had to edit config.lua and set mysql.use_mysqlconfig = true. I figured it out only after seeing a mention of a similar problem with DDNet.

The perfect fix would be build system failure if required libraries are not present on the system. Less perfect fix would be documenting current behavior and/or running reproducible builds somewhere.

bretonium avatar Oct 20 '18 23:10 bretonium

I don't think the problem was caused by a missing library, because infclass clearly managed to contact mysql (Access denied for user 'breton'@'localhost' is an error from the server).

The bug here is a runtime bug, with nothing to do with dependencies; which just happens to go away when you use mysql.use_mysqlconfig = true. I had a similar issue some time ago. Try changing your MySQL password to something simpler, eg. 10 alphanumerical characters.

progval avatar Oct 21 '18 03:10 progval

Eww I just took a look at the code, and noticed that infclass bundles an old version of libmysqlclient. That's probably where the bug is

progval avatar Oct 21 '18 03:10 progval