SA-MP Forums Archive
[Plugin] [REL] MySQL Plugin (Now on github!) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Plugin Development (https://sampforum.blast.hk/forumdisplay.php?fid=18)
+--- Thread: [Plugin] [REL] MySQL Plugin (Now on github!) (/showthread.php?tid=56564)



Re: [REL] MySQL Plugin (Now on github!) - Jeroen52 - 16.10.2016

Quote:
Originally Posted by Egoxper
Посмотреть сообщение
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 :



What can i do with that?
I can see that you are using R40 or beyond, whenever you are using any version that is R40 or higher you'll need to use CentOS 7 due to dependencies not being available on CentOS 6.

This should fix your issue and install the dependencies: yum install -y mariadb-libs.i686 libstdc++.i686


Re: [REL] MySQL Plugin (Now on github!) - Egoxper - 17.10.2016

And can i use it on Ubuntu?


Re: [REL] MySQL Plugin (Now on github!) - Konstantinos - 17.10.2016

Quote:
Originally Posted by dusk
Посмотреть сообщение
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?
Yes, all of them are stored in a single cache which has sub-caches for each result.


Re: [REL] MySQL Plugin (Now on github!) - dusk - 17.10.2016

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Yes, all of them are stored in a single cache which has sub-caches for each result.
Sub-caches? Are they accessed in a different way?


Re: [REL] MySQL Plugin (Now on github!) - Konstantinos - 17.10.2016

Not really, cache_set_active for the main cache and cache_set_result to retrieve the data of the appropriate query (in the order they were sent).


Re: [REL] MySQL Plugin (Now on github!) - dusk - 17.10.2016

Thanks! As for cache_set_active, I've seen people explicitly calling it after every query. Does it need to be done, even for simple queries?


Re: [REL] MySQL Plugin (Now on github!) - Konstantinos - 17.10.2016

If you retrieve the data of all the SELECT queries (in that set) in the specified callback (non-threaded queries wouldn't be recommended at all for that), you don't need cache_set_active function. I assumed you wanted to save the cache for later use, that's its only purpose - to be used anywhere.


Re: [REL] MySQL Plugin (Now on github!) - dusk - 23.10.2016

Hey again, I'm unable to connect to mysql on windows.

I'm running a 32 bit MySQL server. I checked the Task Manager and the process mysqld.exe is running. I created a database which I specify in my mysql.ini file(I use mysql_connect_file). I am able to connect to mysql from the command line.

SAMP log error:
Код:
[14:41:18] Could not connect to mysql database, check if mysql server is running and contains the database specified in mysql.ini file



Re: [REL] MySQL Plugin (Now on github!) - Konstantinos - 23.10.2016

What is written in logs\plugins.txt file?


Re: [REL] MySQL Plugin (Now on github!) - dusk - 23.10.2016

Oh I didn't even notice the cool new logging system! Now I see.. it was just a typo


Re: [REL] MySQL Plugin (Now on github!) - KessMan - 28.10.2016

Hmm...
https://sampforum.blast.hk/showthread.php?tid=620310


Re: [REL] MySQL Plugin (Now on github!) - AndySedeyn - 28.10.2016

Quote:
Originally Posted by KessMan
Посмотреть сообщение
Irrelevant. Your question has been answered in that thread, so there's absolutely no reason to post it all over the forum. You'll end up just getting the same answers here as you got there.


Re: [REL] MySQL Plugin (Now on github!) - decondelite - 29.10.2016

Hello. What is the difference between cache_get_row_count and cache_get_result_count?


Re: [REL] MySQL Plugin (Now on github!) - Konstantinos - 29.10.2016

cache_get_result_count is used for multi-statements. You don't really need it unless all the queries you sent are equivalent and you call the same exact cache functions with the same parameters (same number of columns etc).
pawn Код:
mysql_tquery(MYSQL_DEFAULT_HANDLE, "SELECT 'query 1'; SELECT 'query 2'; SELECT 'query 3';", "OnSomethingLoad", "");

forward OnSomethingLoad();
public OnSomethingLoad()
{
    new tmp[8], results;
   
    cache_get_result_count(results);
    for (new i; i != results; i++)
    {
        cache_set_result(i);
       
        cache_get_value(0, 0, tmp);
        print(tmp);
    }
}



Re: [REL] MySQL Plugin (Now on github!) - Barnwell - 29.10.2016

The old mysql is best version


Re: [REL] MySQL Plugin (Now on github!) - TheOrsini - 10.11.2016

I have proplem with mysql_set_option(); This function don't work

PHP код:
  new MySQLOpt:options mysql_init_options();
  
mysql_set_option(optionsAUTO_RECONNECTfalse);
  
mysql_connection_id mysql_connect(MYSQL_HOSTMYSQL_USERMYSQL_PASSWORDMYSQL_DATABASE); 
Код:
[20:29:59] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #2003 'Can't connect to MySQL server on 'localhost' (10061)'
[20:30:01] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #2003 'Can't connect to MySQL server on 'localhost' (10061)'
[20:30:03] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #2003 'Can't connect to MySQL server on 'localhost' (10061)'
[20:30:05] [plugins/mysql] CConnection::CConnection - establishing connection to MySQL database failed: #2003 'Can't connect to MySQL server on 'localhost' (10061)'



Re: [REL] MySQL Plugin (Now on github!) - Konstantinos - 10.11.2016

https://sampwiki.blast.hk/wiki/MySQL/R40#mysql_set_option

You need to pass "options" variable as argument in mysql_connect function.


Re: [REL] MySQL Plugin (Now on github!) - SwankyPants - 29.11.2016

Great work, i really needed this one to my server!

- Thanks


Re: [REL] MySQL Plugin (Now on github!) - maddinat0r - 04.12.2016

R41-2 has been released.
Changes: Download as always here: https://github.com/pBlueG/SA-MP-MySQL/releases


Re: [REL] MySQL Plugin (Now on github!) - vannesenn - 04.12.2016

all builds from now on prefer the MariaDB C connector"

I don't understand what you want to say.