• 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!

Solved [Error - mysql_real_query] when I try to connect to the server

KrtOwl

New Member
Joined
Jan 14, 2023
Messages
4
Reaction score
1
GitHub
KrtOwl
I'm using TFS 1.6, OTClient Mehah 3.5, MyAAC v1.0-beta.When, UniServerZ
I try to connect the server I get the following error in the server console

Code:
[Error - mysql_real_query] Query: INSERT INTO `sessions` (`token`, `account_id`, `ip`) VALUES ('\\÷¯y,▀♣ß║+c%─\Z_►', 1, INET6_ATON(::1))
Message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '::1))' at line 1
 
Last edited:
What is your database?
MySQL? MariaDB? What version?
  • Servidor: Uniform Server (127.0.0.1 via TCP/IP)
  • Tipo de servidor: MySQL
  • Conexão do servidor: O SSL não está sendo usado
  • Versão do servidor: 8.2.0 - MySQL Community Server - GPL
  • Versão de protocolo: 10
  • Usuário: root@localhost
  • Charset do servidor: UTF-8 Unicode (utf8mb4)


  • Versão do cliente de banco de dados: libmysql - mysqlnd 8.3.0
 
I had the same issue. The IP passed to INET6_ATON isn't quoted, so I changed the source files, just like froomzin did in the link provided by sharinn.
Check MariaDB (or MySQL) documentation for reference:
INET6 (https://mariadb.com/kb/en/inet6/)

I found that weird because older TFS versions have the same code, but I assume they must work with different protocols.
I experienced the situation when connecting to the latest TFS from mehah's OTC, through 13.10 protocol.

Here is the change that I made:

C++:
// FROM   

    if (!db.executeQuery(fmt::format(
            "INSERT INTO `sessions` (`token`, `account_id`, `ip`) VALUES ({:s}, {:d}, INET6_ATON({:s}))",
            db.escapeBlob(sessionKey.data(), sessionKey.size()), account.id, getConnection()->getIP().to_string()))) {
        disconnectClient("Failed to create session.\nPlease try again later.", version);
        return;
    
// TO
    
    if (!db.executeQuery(fmt::format(
            "INSERT INTO `sessions` (`token`, `account_id`, `ip`) VALUES ({:s}, {:d}, INET6_ATON({:s}))",
            db.escapeBlob(sessionKey.data(), sessionKey.size()), account.id, db.escapeString(getConnection()->getIP().to_string())))) {
        disconnectClient("Failed to create session.\nPlease try again later.", version);
        return;
 
Last edited:
can you check default value of expire_at from Session table, should be null
Post automatically merged:

i don't know much about myacc but maybe login webservice provided by accmaker can be issued there, is is provided try remove it/disable part related to send login data to client
 
Last edited:
Back
Top