[MYSQL] MySQL Query unsuccesfull
#1

Код:
[18:48:25] >> mysql_connect( )
[18:48:25] CMySQLHandler::CMySQLHandler() - constructor called.
[18:48:25] CMySQLHandler::CMySQLHandler() - Connecting to "host.godlike.ro" | DB: "gta" | Username: "gta" ...
[18:48:25] CMySQLHandler::Connect() - Can't connect to MySQL server on 'host.godlike.ro' (111) (Error ID: 2003)
Код:
[18:48:25] >> mysql_query( Connection handle: 1 )
[18:48:25] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead)
[18:48:25] >> mysql_store_result( Connection handle: 1 )
[18:48:25] CMySQLHandler::StoreResult() - There is nothing to store (Reason: Connection is dead)
[18:48:25] >> mysql_retrieve_row( Connection handle: 1 )
[18:48:25] CMySQLHandler::RetrieveRow() - You cannot call this function now. (Reason: Connection is dead)
[18:48:25] >> mysql_free_result( Connection handle: 1 )
[18:48:25] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead)
[18:48:25] >> mysql_query( Connection handle: 1 )
[18:48:25] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead)
[18:48:25] >> mysql_store_result( Connection handle: 1 )
[18:48:25] CMySQLHandler::StoreResult() - There is nothing to store (Reason: Connection is dead)
[18:48:25] >> mysql_retrieve_row( Connection handle: 1 )
[18:48:25] CMySQLHandler::RetrieveRow() - You cannot call this function now. (Reason: Connection is dead)
[18:48:25] >> mysql_free_result( Connection handle: 1 )
[18:48:25] CMySQLHandler::FreeResult() - There is nothing to free (Reason: Connection is dead)
[18:50:00] >> mysql_query( Connection handle: 1 )
[18:50:00] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead)
[18:50:00] >> mysql_query( Connection handle: 1 )
[18:50:00] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead)
[18:50:00] >> mysql_query( Connection handle: 1 )
[18:50:00] CMySQLHandler::Query() - You cannot call this function now. (Reason: Connection is dead)
[18:50:00] >> mysql_store_result( Connection handle: 1 )
[18:50:00] CMySQLHandler::StoreResult() - There is nothing to store (Reason: Connection is dead)
[18:50:00] >> mysql_num_rows( Connection handle: 1 )
[18:50:00] CMySQLHandler::NumRows() - You cannot call this function now. (Reason: Dead Connection)
[18:50:00] >> mysql_free_result( Connection handle: 1 )
In server_log.txt, i get a message telling me that the MySQL connection to the database was succesfull.

If i modify DB_HOST with "localhost", he doesn't start because of that:
Код:
samp03svr: amx/amx.c:555: amx_BrowseRelocate: Assertion `op>0 && op<OP_NUM_OPCODES' failed.
Can anyone help me please?
Reply
#2

Quote:

[18:48:25] CMySQLHandler::Connect() - Can't connect to MySQL server on 'host.godlike.ro' (111) (Error ID: 2003)

The connection doesn't seem successfull at all.
Reply
#3

Well i saw that, it's not at all, i can connect to the server and play, but the accounts are not saved in the database.
Reply
#4

It means nothing.

The MySQL server is a thirty-party application linked to the SA-MP server and it will work also if the MySQL database is offline (unless you've decided not to shutting down the server).

But as you said, the data will obviously not be saved because the MySQL database is offline.
Reply
#5

So why do i get that message in server_log, telling me that the connection was succesfull to the database?
And by the way, what do you mean with offline db? Its online.
Reply
#6

Can you show me the message you're talking about?
And I meant that it's not connected to the SA-MP server, sorry.
Reply
#7

Quote:

[18:48:25] SUCCES: Conexiunea la baza de date`gta` a fost stabilita!

That means it was succesfull connected to the database 'gta'.
Reply
#8

That message is sent by your gamemode and is in no way a reliable source. For all I know it could even appear right beneath the connection statement, without any further checks whatsoever. Try inputting 127.0.0.1. "localhost" may not always resolve correctly.
Reply
#9

The server hoster added privileges for localhost right now.

I tried to restart the server using localhost as SQL_HOST and i got these:
Quote:

[19:21:30] >> mysql_connect( )
[19:21:30] CMySQLHandler::CMySQLHandler() - constructor called.
[19:21:30] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "gta" | Username: "gta" ...
[19:21:30] CMySQLHandler::Connect() - Connection was successful.
[19:21:30] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
[19:21:30]
[19:21:30] ---------------------------
[19:21:30] MySQL Debugging activated (07/04/13)
[19:21:30] ---------------------------
[19:21:30]
[19:21:30] >> mysql_query( Connection handle: 1 )
[19:21:30] CMySQLHandler::Query(SELECT * FROM `houses` ORDER BY `houses`.`hID` ASC) - Successfully executed.
[19:21:30] >> mysql_store_result( Connection handle: 1 )
[19:21:30] CMySQLHandler::StoreResult() - Result was stored.
[19:21:30] >> mysql_retrieve_row( Connection handle: 1 )
[19:21:30] >> mysql_fetch_field_row( Connection handle: 1 )
[19:21:30] CMySQLHandler::FetchField("hID") - 1
[19:21:30] >> mysql_fetch_field_row( Connection handle: 1 )

But the server didn't started, and no crash error in GameCP console.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)