Raised This Month: $32 Target: $400
 8% 

two mysql


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-24-2020 , 12:39   two mysql
Reply With Quote #1

hi guys. is it possible to anyhow make cs server connection to two seperate databases?

yesterday i was testing somethng, one plugin was sqlite (paused in plugins.ini with ';' ) and another one was enabled with mysql. But amx is loading only first module (no matter if plugin is enabled/disabled) so i could not work with mysql one, until i removed the first from plugins.ini

thanks in advance
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 04-24-2020 , 12:55   Re: two mysql
Reply With Quote #2

Most plugins connect to a remote database with whatever credentials and host are defined in the sql.cfg file, however, plugins may define their own target databases so theoretically (haven't tested it), yes.
__________________
gabuch2 is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-24-2020 , 14:24   Re: two mysql
Reply With Quote #3

Im more interested in two databases from different hosts, guess that makes a difference

EDIT: same question for nvault and fvault, if anyone can confirm and tested you can use two different nvaults i would aprecciate
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 04-24-2020 at 17:42.
JocAnis is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-25-2020 , 11:10   Re: two mysql
Reply With Quote #4

if anyone is interested, you can go with 2 sqlite databases on one server, but i tested only with:
Code:
#pragma defclasslib sqlx sqlite
#include <sqlx>
would be cool if anyone else can share similar knowledge about databases/saving methods
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 04-25-2020 at 11:12.
JocAnis is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-25-2020 , 11:31   Re: two mysql
Reply With Quote #5

Quote:
Originally Posted by JocAnis View Post

EDIT: same question for nvault and fvault, if anyone can confirm and tested you can use two different nvaults i would aprecciate
Of course you can use both, why wouldn't you be able to? Is it just because they both have "vault" in their name?
__________________

Last edited by HamletEagle; 04-25-2020 at 11:32.
HamletEagle is offline
JocAnis
Veteran Member
Join Date: Jun 2010
Old 04-25-2020 , 15:17   Re: two mysql
Reply With Quote #6

i mean, two nvault or two fvault, not 1 nvault + 1 fvault, becase that will work obviously
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)
JocAnis is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 04-25-2020 , 16:28   Re: two mysql
Reply With Quote #7

Still yes. Do you have only one file in your pc? Nope, you don't.
__________________
HamletEagle is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-26-2020 , 18:34   Re: two mysql
Reply With Quote #8

You may need to use SQL_SetAffinity() to flip between each. I've never done this personally so not 100% sure about the behavior.

Edit: Disregard, I initially thought you meant the same plugin needed to use different SQL drivers. Separate plugins should have no issue using different SQL drivers.

PHP Code:
SQL_SetAffinity"sqlite" ); //flip to sqlite database affinity
SQL_ExecuteszQuery ); //submit query to sqlite database
SQL_SetAffinity"mysql" ); //flip back to mysql to allow querying mysql database 
__________________

Last edited by Bugsy; 04-26-2020 at 18:40.
Bugsy is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 03:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode