SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 02/07/2015, 11:50 AM   #5621
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by maddinat0r View Post
You'll have to externally download the static MySQL client library and manually link it by modifying the makefile. I usually did that by downloading the MySQL client debug files from a Debian package repo, extracting it manually, moving the libmysqlclient.a into the MySQL plugin source folder, and replacing "-Wl,-Bstatic -lmysqlclient_r -Wl,-Bdynamic" with ""path/to/libmysql.a"" in the makefile (this won't work with R40 though).

pro tip: you can use the static MySQL plugin from the Debian download if you don't want to compile the plugin by yourself, it should work on CentOS too (I officially discourage from doing that though).
Thanks! It seems to work.
ALso, why won't it work in R40? I kind of depend on using static MySQL libraries.

Quote:
Originally Posted by V1ceC1ty View Post
Anyone got a static version of R39 for Centos?
I have a static build for R39-3 for CentOS 6.6, do you want it?
__________________
Jeroen52 is offline   Reply With Quote
Old 02/07/2015, 03:22 PM   #5622
maddinat0r
Banned
 
Join Date: Jun 2010
Location: Germany
Posts: 845
Reputation: 482
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by Vince View Post
Code:
[00:58:34] [WARNING] CMySQLHandle::SaveActiveResult - active cache was already saved
What causes this and how can I locate the culprit? The warning message provides no useful information. No cacheid, no callback, no query.
This happens if you call "cache_save()" twice.


Quote:
Originally Posted by Jeroen52 View Post
Thanks! It seems to work.
ALso, why won't it work in R40? I kind of depend on using static MySQL libraries.
[...]
Because I switched to CMake, thus it won't be easy to modify the makefile like it is now. It should still be possible though by placing the libmysqlclient.a into the right folder (like "/usr/lib/mysql/" or wherever the libmysqlclient.so is).
maddinat0r is offline   Reply With Quote
Old 02/07/2015, 11:01 PM   #5623
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by maddinat0r View Post
This happens if you call "cache_save()" twice.



Because I switched to CMake, thus it won't be easy to modify the makefile like it is now. It should still be possible though by placing the libmysqlclient.a into the right folder (like "/usr/lib/mysql/" or wherever the libmysqlclient.so is).
Glad to hear that it is still possible.

If anyone needs a static plugin for CentOS 6.6 just say so and I'll upload it.
Maybe it can even be added to the R39-3 release page.
__________________
Jeroen52 is offline   Reply With Quote
Old 03/07/2015, 12:06 AM   #5624
V1ceC1ty
Banned
 
Join Date: Oct 2008
Location: West Australia
Posts: 1,896
Reputation: 273
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by Jeroen52 View Post
I have a static build for R39-3 for CentOS 6.6, do you want it?
It's alright thanks for your help, I switched to Debain since a couple of other plugins were having the same issue.
V1ceC1ty is offline   Reply With Quote
Old 03/07/2015, 03:10 PM   #5625
Typhome
Gangsta
 
Typhome's Avatar
 
Join Date: Mar 2009
Location: Estonia
Posts: 950
Reputation: 10
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by Jeroen52 View Post
I have a static build for R39-3 for CentOS 6.6, do you want it?
Please upload it and share link.

Code:
[root@ns326046 SA-MP-MySQL-R39-3]# make dynamic
Compiling plugin..
Compiling plugin SDK..
Linking (dynamic)..
Done.
Code:
[17:09:15] 
[17:09:15] Server Plugins
[17:09:15] --------------
[17:09:15]  Loading plugin: crashdetect.so
[17:09:15]   CrashDetect v4.15.1 is OK.
[17:09:15]   Loaded.
[17:09:15]  Loading plugin: mysql.so
Looks like it crashed. New server - CentOS 6.6 32-bit

Code:
GPP=g++ -m32
GCC=gcc -m32


COMPILE_FLAGS = -c -O3 -w -fPIC -DLINUX -Wall -I libs/ -I libs/sdk/amx/
LIBRARIES = -pthread -lrt -Wl,-Bstatic -lboost_thread -lboost_chrono -lboost_date_time -lboost_system -lboost_atomic -Wl,-Bdynamic


all: compile dynamic_link static_link clean
dynamic: compile dynamic_link clean
static: compile static_link clean

compile:
        @mkdir -p bin
        @echo Compiling plugin..
        @ $(GPP) $(COMPILE_FLAGS) -std=c++0x src/*.cpp
        @echo Compiling plugin SDK..
        @ $(GPP) $(COMPILE_FLAGS) libs/sdk/*.cpp
        @ $(GCC) $(COMPILE_FLAGS) libs/sdk/amx/*.c

dynamic_link:
        @echo Linking \(dynamic\)..
        @ $(GPP) -O2 -fshort-wchar -shared -o "bin/mysql.so" *.o -L/usr/lib/mysql/libmysqlclient_r.so $(LIBRARIES)

static_link:
        @echo Linking \(static\)..
        @ $(GPP) -O2 -fshort-wchar -shared -o "bin/mysql_static.so" *.o -Wl,-Bstatic -lmysqlclient_r -Wl,-Bdynamic $(LIBRARIES)

clean:
        @ rm -f *.o
        @echo Done.
Well.. I think I should change OS from CentOS to Debian.. but 32 or 64 bit.
__________________
Eesti SA-MP Kommuun
Typhome is offline   Reply With Quote
Old 03/07/2015, 11:29 PM   #5626
vannesenn
Gangsta
 
vannesenn's Avatar
 
Join Date: Feb 2011
Posts: 607
Reputation: 15
Question Re: [REL] MySQL Plugin (Now on github!)

Which plugin I need to plug in on Linux? ._mysql.so or mysql.so?
vannesenn is offline   Reply With Quote
Old 04/07/2015, 01:18 AM   #5627
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by Typhome View Post
Please upload it and share link.

Code:
[root@ns326046 SA-MP-MySQL-R39-3]# make dynamic
Compiling plugin..
Compiling plugin SDK..
Linking (dynamic)..
Done.
Code:
[17:09:15] 
[17:09:15] Server Plugins
[17:09:15] --------------
[17:09:15]  Loading plugin: crashdetect.so
[17:09:15]   CrashDetect v4.15.1 is OK.
[17:09:15]   Loaded.
[17:09:15]  Loading plugin: mysql.so
Looks like it crashed. New server - CentOS 6.6 32-bit

Code:
GPP=g++ -m32
GCC=gcc -m32


COMPILE_FLAGS = -c -O3 -w -fPIC -DLINUX -Wall -I libs/ -I libs/sdk/amx/
LIBRARIES = -pthread -lrt -Wl,-Bstatic -lboost_thread -lboost_chrono -lboost_date_time -lboost_system -lboost_atomic -Wl,-Bdynamic


all: compile dynamic_link static_link clean
dynamic: compile dynamic_link clean
static: compile static_link clean

compile:
        @mkdir -p bin
        @echo Compiling plugin..
        @ $(GPP) $(COMPILE_FLAGS) -std=c++0x src/*.cpp
        @echo Compiling plugin SDK..
        @ $(GPP) $(COMPILE_FLAGS) libs/sdk/*.cpp
        @ $(GCC) $(COMPILE_FLAGS) libs/sdk/amx/*.c

dynamic_link:
        @echo Linking \(dynamic\)..
        @ $(GPP) -O2 -fshort-wchar -shared -o "bin/mysql.so" *.o -L/usr/lib/mysql/libmysqlclient_r.so $(LIBRARIES)

static_link:
        @echo Linking \(static\)..
        @ $(GPP) -O2 -fshort-wchar -shared -o "bin/mysql_static.so" *.o -Wl,-Bstatic -lmysqlclient_r -Wl,-Bdynamic $(LIBRARIES)

clean:
        @ rm -f *.o
        @echo Done.
Well.. I think I should change OS from CentOS to Debian.. but 32 or 64 bit.
Here is the static compiled plugin that I compiled for CentOS 6: https://mirror.jeroendeneef.com/samp...ysql_static.so
I have compiled it on a 32-bit CentOS 6.5 virtual machine, it works on my 64-bit CentOS 6.6 dedi.

Quote:
Originally Posted by vannesenn View Post
Which plugin I need to plug in on Linux? ._mysql.so or mysql.so?
What distro are you using?
__________________
Jeroen52 is offline   Reply With Quote
Old 04/07/2015, 12:27 PM   #5628
vannesenn
Gangsta
 
vannesenn's Avatar
 
Join Date: Feb 2011
Posts: 607
Reputation: 15
Default Re: [REL] MySQL Plugin (Now on github!)

I'm not sure jet. I'll take VPS from OVH and I don't know which distro I'll take. I asked which .so file I need to use because both files(.so) are from Centos(Linux distro?)
vannesenn is offline   Reply With Quote
Old 04/07/2015, 01:06 PM   #5629
Jeroen52
Gangsta
 
Jeroen52's Avatar
 
Join Date: Oct 2008
Location: The Netherlands
Posts: 882
Reputation: 74
Default Re: [REL] MySQL Plugin (Now on github!)

Quote:
Originally Posted by vannesenn View Post
I'm not sure jet. I'll take VPS from OVH and I don't know which distro I'll take. I asked which .so file I need to use because both files(.so) are from Centos(Linux distro?)
Well, currently only CentOS6, CentOS7, Debian7 and Windows have builds.
You can however compile your own build.
__________________
Jeroen52 is offline   Reply With Quote
Old 04/07/2015, 02:06 PM   #5630
vannesenn
Gangsta
 
vannesenn's Avatar
 
Join Date: Feb 2011
Posts: 607
Reputation: 15
Default Re: [REL] MySQL Plugin (Now on github!)

Who? I didn't work in Visual Studio.
vannesenn is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
****** Project: Glass int3s0 Everything and Nothing 99 26/02/2013 04:22 PM
MySQL Plugin R5 plugin problem dud Scripting Help 12 05/12/2011 06:28 PM
Strikens Mysql vs BlueG's Mysql plugin PrawkC Scripting Help 4 30/09/2011 10:30 AM
[help][plugin] Can't load mysql plugin mariomako Help Archive 8 16/07/2011 02:37 PM
mysql plugin. loading plugin failed ikkentim Help Archive 2 10/02/2011 02:32 PM


All times are GMT. The time now is 12:43 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.