• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

Problems connecting TFS 1.6 and 1.7 to MySQL/MariaDB (different errors)

mysticbunny

Member
Joined
Jul 30, 2025
Messages
17
Reaction score
13
Hello everyone,

I’ve been trying to set up The Forgotten Server both on version 1.6 (stable) and the current 1.7 (master), but I’m stuck with different database connection issues on each version. I’d really appreciate some guidance from the community, since I couldn’t get either of them to work correctly.

TFS 1.7 (master branch, freshly compiled)​

Compilation works fine, no errors. But when I try to run the server, I get this:
Code:
C:\otserv\forgottenserver>tfs.exe
The Forgotten Server - Version 1.7
Compiled with Microsoft Visual C++ version 1944
Compiled on Sep  4 2025 14:12:45 for platform x64
Linked with Lua 5.4.8 for Lua support

>> Loading config
>> Loading RSA key
>> Establishing database connection...
MySQL Error Message: TLS/SSL error: SSL is required, but the server does not support it
> ERROR: Failed to connect to database.
>> No services running. The server is NOT online.
It looks like the MariaDB connector from vcpkg is forcing SSL, but my MariaDB (XAMPP) doesn’t have it configured. I tried enabling SSL in MariaDB, but it crashes on startup. I also tried disabling it via config, but the flag require_secure_transport is not recognized by MariaDB in XAMPP.

So far I haven’t found a clean way to make TFS 1.7 connect.

---------------------------------------------- ----------------------------------------------

TFS 1.6 (stable release)​


Here the server does connect to the database, I was able to import the schema and also set up MyAAC.
I can access the website, create an account and character, and the database updates correctly.

But when I try to log in with the client, I get the error:
Code:
Login error: "Failed to create session. Please try again later."
And in the server console I see:
Code:
[Error - mysql_real_query] Query: INSERT INTO sessions (token, account_id, ip)
VALUES ('\\÷¯y,▀♣ß║+c%─\Z_►', 1, INET6_ATON(::ffff:127.0.0.1))
Message: You have an error in your SQL syntax; check the manual that corresponds
to your MariaDB server version for the right syntax to use near '::ffff:127.0.0.1))' at line 1
So it seems the SQL syntax that TFS is generating isn’t compatible with MariaDB (XAMPP) when trying to insert the IP using INET6_ATON.

---------------------------------------------- ----------------------------------------------

Summary​

  • TFS 1.6: connects to DB, but login fails due to SQL syntax error with INET6_ATON(::ffff:127.0.0.1).
  • TFS 1.7: fails to connect to DB at all, because SSL/TLS is required by the connector but not supported by MariaDB (XAMPP).
I’m open to using either version (1.6 or 1.7), I just need to get one of them fully working end-to-end (server + MyAAC + client login).
Has anyone else faced these issues? What would be the recommended fix?

Thanks in advance!
 
TFS 1.7:
We - developers - know that TFS does not work for months. Nobody cares:
There are some fixes, I've posted in this thread months ago, but they are not accepted/merged into official TFS. Nobody cares.

TFS 1.6/1.7:
We know that TFS is not able to handle login sessions like any other OTS since 2024 (ex. MyAAC website). Again, nobody cares:
I've posted solutions to the problem. Some people still argue with me for 2 months. IDC.

So, it's now normal, that you cannot login into official TFS server for X months.
Has anyone else faced these issues? What would be the recommended fix?
Go Linux, but some stable one like Ubuntu 22.04 or Ubuntu 24.04, as newest linuxes like Ubuntu 25.10 fails to connect to MySQL too.

If you don't need 12+ Tibia, you can use my Tibia 10.98 TFS 1.4 version with compilation fixes:
It compiles and works on all systems (Windows/Linux).
 

[SOLVED] TLS/SSL error: SSL is required, but the server does not support it (TFS 1.7)​

We found an alternative solution that allowed us to finally put the server online.
Although I’m not a professional developer, but I wanted to document the full step-by-step here so that anyone facing the same issue can fix it.

I also want to sincerely thank all the developers of this project — without your work in making TFS available, none of this would be possible. 🙏


After compiling TFS 1.7, starting the server always showed:
Establishing database connection...
MySQL Error Message: TLS/SSL error: SSL is required, but the server does not support it
ERROR: Failed to connect to database.
No services running. The server is NOT online.
This happens because recent versions of MariaDB Connector (via vcpkg) now enforce TLS/SSL by default, but MariaDB/MySQL in XAMPP is not configured with SSL.
Result: client requires SSL → server doesn’t provide it → connection fails.

Step-by-step fix​

1. Generate local SSL certificates (self-signed) using the OpenSSL bundled with XAMPP​

Run in an Administrator Command Prompt:
Code:
set OPENSSL_CONF=C:\xampp\apache\conf\openssl.cnf
cd /d C:\xampp\mysql\certs


"C:\xampp\apache\bin\openssl.exe" genrsa -out ca-key.pem 2048
"C:\xampp\apache\bin\openssl.exe" req -new -x509 -key ca-key.pem -out ca.pem -days 365 -subj "/CN=Local MariaDB CA"


"C:\xampp\apache\bin\openssl.exe" genrsa -out server-key.pem 2048
"C:\xampp\apache\bin\openssl.exe" req -new -key server-key.pem -out server-req.pem -subj "/CN=127.0.0.1"


"C:\xampp\apache\bin\openssl.exe" x509 -req -in server-req.pem -days 365 -sha256 ^
-CA ca.pem -CAkey ca-key.pem -CAcreateserial ^
-out server-cert.pem
This creates:
Code:
C:\xampp\mysql\certs\ca.pem
C:\xampp\mysql\certs\server-cert.pem
C:\xampp\mysql\certs\server-key.pem

2. Edit​

Inside the [mysqld] section, add:
Code:
ssl-ca=C:/xampp/mysql/certs/ca.pem
ssl-cert=C:/xampp/mysql/certs/server-cert.pem
ssl-key=C:/xampp/mysql/certs/server-key.pem
⚠️ Use / or \\ in paths. Do not use single \.
Make sure these lines are inside [mysqld], not [client].

3. Restart MySQL in XAMPP​

  • Stop → Start in the XAMPP panel.
  • If it doesn’t start, check mysql_error.log (most often it’s a wrong path or missing file).

4. Test SSL manually​

Code:
mysql -u root -p --host=127.0.0.1 --ssl-mode=REQUIRED
Inside MySQL:
SQL:
SHOW VARIABLES LIKE 'ssl_%';
You should see ssl_ca, ssl_cert, ssl_key pointing to the certs you just created.

5. Run TFS again​

Now the server starts without errors:
Establishing database connection... MySQL 3.4.5
Running database manager
Forgotten Server Online!
With this setup, the MariaDB server actually supports SSL, the connector stops failing, and TFS 1.7 comes online normally.

However, after logging into the server, walking with the character and even restarting without any visible errors in the log,
when trying to connect again the client shows:
Code:
Erro de autentificação: failed to create session. Please try again later.
And in the console log:
Code:
[Error - mysql_real_query] Query: INSERT INTO sessions (token, account_id, ip) VALUES ('\÷¯y,▀ß║+c%─\Z_', 1, INET6_ATON('::ffff:127.0.0.1'))
Message: Duplicate entry '\xF6\xEEy,\xDF\x05\xE1\xBA+c%\xC4\x1A_\x10' for key 'token'
So in version 1.7 we face the same error as in version 1.6.

Now that I was able to solve the first problem (TLS/SSL), I will try to follow the suggested solution for this new problem, which apparently is shared by both versions:
👉 https://github.com/otland/forgottenserver/issues/4963
 
Now that I was able to solve the first problem (TLS/SSL), I will try to follow the suggested solution for this new problem, which apparently is shared by both versions:
There is no real solution for TFS.
You have to connect to 8080 HTTP port (TFS HTTP) ex. http://127.0.0.1:8080 to login from client:
to make it work. You cannot use any acc. maker on port 80/443 to handle TFS connections ex. http://127.0.0.1/login.php.

If you use 12+ RL Tibia client, you may need to use this tool to change IP and ports to change loginWebService: to http://127.0.0.1:8080/ for localhost:
 
So sad… well, I guess the solution to actually have fun is to follow your advice and use the 10.98 version you provided:
https://github.com/gesior/forgottenserver-gesior

It seems like a much more promising investment of time. To be honest, I was looking for something more nostalgic, but I decided to use the newest available version because I believed it would have fewer errors… but apparently not hahaha.

So it’s fine to go with an older version, it might even be better. I was going to disable many of the 12.x features anyway, I just didn’t want something too old like 8.6. So 10.98 looks really promising.

By the way, did you post this link you sent me in any forum topic?
 
By the way, did you post this link you sent me in any forum topic?
I've posted more info about it in this post:

There are more people that work on TFS 1.4 (10.98) updates, than on newest TFS (1.6+) versions.
There are also people who work on 7.x and 8.x protocols downgrades based on TFS 1.4 ex. MillhioreBT 8.6:
 
otland need to make branches like 12.x 19.x 8.x 7.x and put it all together in order to work smarter otland coommunity si all scattered by this reason we and most ppl don't know what to use and ends up using deprecated things and such
 
Back
Top