pBlueG / SA-MP-MySQL

MySQL plugin for San Andreas Multiplayer
BSD 3-Clause "New" or "Revised" License
196 stars 80 forks source link

Connection Error: Can't initialize character set unknown #203

Open silver-break opened 5 years ago

silver-break commented 5 years ago

In the particular case, when connecting from a local computer (Windows 10; 0.3.7-R2; latest version of plugin) to a remote database (Debian 9, mysql version 8.0.12), an error occurs:

[ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #2019 'Can't initialize character set unknown (path: compiled_in)'

Function "mysql_set_charset("cp1251", g_SQL);" - called with the argument cp1251 and lower in code (it does not reach execution)

The most interesting thing is that the server starts up and correctly connects to the database, if you start it from the VDS where the database is located

XEGARE commented 5 years ago

I have the same problem. Version mysql 8.0.13. mysql server and samp server stand on windows 10. I think the problem is that your plugin is not designed for this version of mysql.

[11:37:57] [INFO] changed log level from 'warning, error' to 'debug, info, warning, error'
[11:37:57] [DEBUG] mysql_connect("localhost", "root", "*****", "dm", 0) (C:\Users\pilip\Desktop\DeathMatch Server\gamemodes\new.pwn:74)
[11:37:57] [DEBUG] CHandleManager::Create(this=0x62a280, host='localhost', user='root', pass='****', db='dm', options=0x61ee20)
[11:37:57] [INFO] Creating new connection handle...
[11:37:57] [DEBUG] CConnection::CConnection(this=0x62a440, host='localhost', user='root', passw='****', db='dm', options=0x61ee20)
[11:37:57] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #2019 'Can't initialize character set unknown (path: compiled_in)'
[11:37:57] [DEBUG] CConnection::CConnection(this=0x38a8020, host='localhost', user='root', passw='****', db='dm', options=0x61ee20)
[11:37:57] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #2019 'Can't initialize character set unknown (path: compiled_in)'
[11:37:57] [DEBUG] CThreadedConnection::CThreadedConnection(this=0x38a8020, connection=0x38a8020)
[11:37:57] [DEBUG] CConnectionPool::CConnectionPool(size=2, this=0x62a480)
[11:37:57] [DEBUG] CConnection::CConnection(this=0x3a7d020, host='localhost', user='root', passw='****', db='dm', options=0x61ee20)
[11:37:57] [DEBUG] CThreadedConnection::WorkerFunc(this=0x38a8020, connection=0x38a8020)
[11:37:57] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #2019 'Can't initialize character set unknown (path: compiled_in)'
[11:37:57] [DEBUG] CThreadedConnection::WorkerFunc(this=0x3a7d020, connection=0x3a7d020)
[11:37:57] [DEBUG] CThreadedConnection::CThreadedConnection(this=0x3a7d020, connection=0x3a7d020)
[11:37:57] [DEBUG] CConnection::CConnection(this=0x3c48020, host='localhost', user='root', passw='****', db='dm', options=0x61ee20)
[11:37:57] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #2019 'Can't initialize character set unknown (path: compiled_in)'
[11:37:57] [DEBUG] CThreadedConnection::CThreadedConnection(this=0x3c48020, connection=0x3c48020)
[11:37:57] [INFO] Connection handle with id '1' successfully created.
[11:37:57] [DEBUG] CHandleManager::Create - new handle = 0x614d58
[11:37:57] [DEBUG] mysql_connect: return value: '1' (C:\Users\pilip\Desktop\DeathMatch Server\gamemodes\new.pwn:74)
[11:37:57] [DEBUG] CThreadedConnection::WorkerFunc(this=0x3c48020, connection=0x3c48020)
[11:37:57] [DEBUG] mysql_errno(1) (C:\Users\pilip\Desktop\DeathMatch Server\gamemodes\new.pwn:76)
[11:37:57] [DEBUG] CHandle::GetErrorId(this=0x614d58)
[11:37:57] [DEBUG] CConnection::GetError(this=0x62a440, connection=0x638928)
[11:37:57] [DEBUG] CHandle::GetErrorId - return value: true, error id: '2019', error msg: 'Can't initialize character set unknown (path: compiled_in)'
[11:37:57] [DEBUG] mysql_errno: return value: '2019' (C:\Users\pilip\Desktop\DeathMatch Server\gamemodes\new.pwn:76)
George480 commented 5 years ago

I think the problem is that your plugin is not designed for this version of mysql.

It works with MySQL 8.0.12 that I have installed. Open my.ini and set character-set for mysql server and client:

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

Restart mysql service and try to connect.

XEGARE commented 5 years ago

I think the problem is that your plugin is not designed for this version of mysql.

It works with MySQL 8.0.12 that I have installed. Open my.ini and set character-set for mysql server and client:

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

Restart mysql service and try to connect.

Thank you. After going through another problem, the connection was successful.

mixno35 commented 11 months ago

Try using an older version of MySQL, for example 5.6

mayurmarvel commented 10 months ago

I think the problem is that your plugin is not designed for this version of mysql.

It works with MySQL 8.0.12 that I have installed. Open my.ini and set character-set for mysql server and client:

[client]
default-character-set = utf8mb4

[mysql]
default-character-set = utf8mb4

[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

Restart mysql service and try to connect.

If you encounter this error on a Linux machine, locate the "my.cnf" configuration file. In my case, I found it at "/etc/my.cnf." You can use the "find / -name my.cnf" command to search for it. Append the statements mentioned above, save the file, and then restart MySQL .