[Plugin] [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by MerryDeer
Посмотреть сообщение
What difference between

cache_num_rows

and

cache_get_row_count ?
pawn Код:
// from a_mysql.inc
stock cache_num_rows()
{
    new row_count;
    cache_get_row_count(row_count);
    return row_count;
}
It returns the row count instead of having to store it in a variable.
Reply

Код:
[08:32:41]  Loading plugin: mysql.so
[08:32:41]   Failed (libmysqlclient.so.18: cannot open shared object file: No such file or directory)
How may i fix this issue on Centos 7 ?
Reply

Quote:

[23:39:59] [debug] Server crashed while executing Mod.amx
[23:39:59] [debug] AMX backtrace:
[23:39:59] [debug] #0 native cache_get_value_name () from mysql.DLL
[23:39:59] [debug] #1 006e0c5c in public LoadGangs () at Mod.pwn:57755
[23:39:59] [debug] Native backtrace:
[23:39:59] [debug] #0 77d2ddf7 in ?? () from C:\WINDOWS\SYSTEM32\ntdll.dll
[23:39:59] [debug] #1 77d0136f in ?? () from C:\WINDOWS\SYSTEM32\ntdll.dll
[23:39:59] [debug] #2 6cca49a5 in ?? () from C:\WINDOWS\SYSTEM32\VCRUNTIME140.dll
[23:39:59] [debug] #3 6bdb9fab in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #4 6bdb9b2e in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #5 6bdba71f in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #6 6bdb9c7a in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #7 6bdb39f7 in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #8 6bdbf6d5 in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #9 6bdcfbd0 in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #10 6bdd3541 in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #11 004010b6 in ?? () from samp-server.exe
[23:39:59] [debug] #12 6cb6c6fa in ?? () from plugins\crashdetect.DLL
[23:39:59] [debug] #13 6cb72278 in ?? () from plugins\crashdetect.DLL
[23:39:59] [debug] #14 6cb6a0d7 in ?? () from plugins\crashdetect.DLL
[23:39:59] [debug] #15 6cb6c74a in ?? () from plugins\crashdetect.DLL
[23:39:59] [debug] #16 6bd64509 in ?? () from plugins\streamer.DLL
[23:39:59] [debug] #17 6bdb8682 in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #18 6bdd0f83 in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #19 6bdd1ffc in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #20 6bdbcc61 in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #21 6bdbce53 in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #22 6bdbe7fe in ?? () from plugins\mysql.DLL
[23:39:59] [debug] #23 00469a66 in ?? () from samp-server.exe
[23:39:59] [debug] #24 0048d4db in ?? () from samp-server.exe
[23:39:59] [debug] #25 0049b4a1 in ?? () from samp-server.exe
[23:39:59] [debug] #26 0049b4b1 in ?? () from samp-server.exe

errors.log

Quote:

[23:39:55] [log-core] exception 0XE06D7363 (<unknown>) from Unhandled Exception Handler catched; shutting log-core down

Crash because this:

mysql_log(ERROR | WARNING);
Reply

Is there a query I can make that'd turn NULL to 0 so I wouldn't have to grab the data as string and strval it to avoid the warning it drops in my mysql log? Sadly I'm really annoyed by such warnings that floods the log.
Reply

What a great way to break compatibility.....


Will be sticking to R39-6.
Reply

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Код:
[08:32:41]  Loading plugin: mysql.so
[08:32:41]   Failed (libmysqlclient.so.18: cannot open shared object file: No such file or directory)
How may i fix this issue on Centos 7 ?
....
Reply

@eco1999: https://sampforum.blast.hk/showthread.php?pid=3765459#pid3765459

Quote:
Originally Posted by PrO.GameR
Посмотреть сообщение
Is there a query I can make that'd turn NULL to 0 so I wouldn't have to grab the data as string and strval it to avoid the warning it drops in my mysql log? Sadly I'm really annoyed by such warnings that floods the log.
pawn Код:
"SELECT ..., IFNULL(column, 0), ..."
If the value of the specified column is NULL will be returned as 0 or any other number you set it to.

You can also check in the script before retrieving its value if it is null with cache_is_value_null and set a default value. If it is not, then retrieving it with cache_is_value_int but I find the first method way better.

Quote:
Originally Posted by oMa37
Посмотреть сообщение
Код:
[08:32:41]  Loading plugin: mysql.so
[08:32:41]   Failed (libmysqlclient.so.18: cannot open shared object file: No such file or directory)
How may i fix this issue on Centos 7 ?
https://github.com/pBlueG/SA-MP-MySQL#faq
Reply

I swapped it now, but its still not working. There is no mysql log-file in my SAMP-Server folder...
http://postimg.org/image/ajt42i4up/
Reply

It is now saved in log/plugins/mysql.txt
Reply

Quote:
Originally Posted by Akastos
Посмотреть сообщение
I cant read from or write in my database. Its like i have no connection to it. (R41, No Errors/Warnings)

Код:
#include <a_mysql>
new MySQL:ServerDB;
public OnGameModeInit()  
{
    ServerDB = mysql_connect("25.78.215.206","samp_server","samp_server",//censored); //ip-adress via hamachi, no log-errors
    return 1;
}

//InAnotherFunction:
        new string[300];
	new VehicleID = GetPlayerVehicleID(playerid);
	new ModelID = GetVehicleModel(VehicleID);
	new Farbe1,Farbe2,Float:x,Float:y,Float:z,Float:zrot;
	GetVehicleColor(VehicleID,Farbe1,Farbe2);
	GetVehiclePos(VehicleID,x,y,z);
	GetVehicleZAngle(VehicleID,zrot);
	format(string,sizeof(string),"INSERT INTO fahrzeuge (Modelid,x,y,z,zrot,Farbe1,Farbe2) VALUES ('%i','%f','%f','%f','%f','%i','%i')",ModelID,x,y,z,zrot,Farbe1,Farbe2);
        mysql_query(ServerDB,string,false);
http://www.directupload.net/file/d/4...gr9w6y_png.htm
mysql_query(ServerDB, string);
Reply

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
It is now saved in log/plugins/mysql.txt
Thx, found it now.
"Acces denied"

Код:
[12:49:52] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'samp_server'@'localhost' (using password: YES)'
[12:49:52] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'samp_server'@'localhost' (using password: YES)'
[12:49:52] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'samp_server'@'localhost' (using password: YES)'
[12:49:52] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'samp_server'@'localhost' (using password: YES)'
Reply

Quote:
Originally Posted by Akastos
Посмотреть сообщение
Thx, found it now.
"Acces denied"

Код:
[12:49:52] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'samp_server'@'localhost' (using password: YES)'
[12:49:52] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'samp_server'@'localhost' (using password: YES)'
[12:49:52] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'samp_server'@'localhost' (using password: YES)'
[12:49:52] [ERROR] CConnection::CConnection - establishing connection to MySQL database failed: #1045 'Access denied for user 'samp_server'@'localhost' (using password: YES)'
You are not connect mysql database.
Reply

Yes but i dont know why i am not.
Reply

First of all make sure that the parameters are correct in mysql_connect and I'm not only referring to the swapped parameters but the rest of the information as well (host, username, password, database).

Remove logs folder and run the server again. If the logs/plugins folder does not exist, it means the connection was successful (no errors/warnings whatsoever).
Reply

Okay, my user got no privileges, after i gave him all privileges everything worked. Thanks.
ATM im just getting one error, that zrot cant be found...
Код:
[21:22:39] [ERROR] cache_get_value_name_float: field 'zrot' not found
http://www.directupload.net/file/d/4...z82a7q_png.htm
Reply

Compile with debug info to get the exact line: https://github.com/Zeex/samp-plugin-...ith-debug-info

You'll be able to find from where it was called. A reason that can also occur is this:
pawn Код:
SELECT Modelid, x, y, z, Farbe1, Farbe2 FROM table_name WHERE ID = ...
and "zrot" hasn't been selected.
Reply

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Compile with debug info to get the exact line: https://github.com/Zeex/samp-plugin-...ith-debug-info

You'll be able to find from where it was called. A reason that can also occur is this:
pawn Код:
SELECT Modelid, x, y, z, Farbe1, Farbe2 FROM table_name WHERE ID = ...
and "zrot" hasn't been selected.
Thanks a lot, i forgot to select zrot in mysql_tquery in OnGameModeInit.
Reply

oh R41 released Thanks !
Reply

Hi, i need help w/ this plugin on Ubuntu.

I tried last Debian and last CentOS version (i read on internet Debian is closer to Ubuntu) and in server log shows me this :

Quote:

[19:28:15] Loading plugin: log-core.so
[19:28:15] Failed (/usr/lib32/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by plugins/log-core.so))
[19:28:15] Loading plugin: mysql.so
[19:28:15] Failed (libmysqlclient.so.18: cannot open shared object file: No such file or directory)

What can i do with that?
Reply

Hey, good job on the R40. I'm loving it!

I see it finally supports multiple statements in one query. So if I execute multiple select statements, will all of the results be available in one cache?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)