AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SQLx remote server? (https://forums.alliedmods.net/showthread.php?t=51887)

Afrow UK 02-25-2007 17:15

SQLx remote server?
 
Is it possible to connect to a MySQL database on a different machine than the one running the server using SQLx? I've tried giving it a different IP address or domain name and it still tries to connect to my IP address (the error generated shows this). Thanks -Stu

MaximusBrood 02-25-2007 17:17

Re: SQLx remote server?
 
It's perfectly possible to use a remote SQL server.
Show your code so we can see what you're doing wrong :)

Afrow UK 02-25-2007 17:37

Re: SQLx remote server?
 
Here is the source code.
I was using the DBI module before and I had the same problem...

-Stu

Afrow UK 02-25-2007 18:28

Re: SQLx remote server?
 
Interestingly, first time I load the plugin with the IP address set to 64.22.68.4 (if I use SQL_MakeStdTuple instead with sql.cfg), it says in amxx plugins that it failed to connect to 127.0.0.1, and then if I restart the server it says it failed to connect to 88.104.241.210! What's going on here??

-Stu

Afrow UK 02-25-2007 21:55

Re: SQLx remote server?
 
1 Attachment(s)
So I've just tried a few SQL plugins on this site (DBI and SQLx) and they all do the same thing. They first say that it couldn't connect to 127.0.0.1 then when I restart the server it says that it couldn't connect to my actual IP address. I'm not giving it 127.0.0.1 nor am I giving it my actual IP address... I'm giving it hiprmod.net as the host.

I also tried to connect to my MySQL server on gamespy... and that failed too!!
However, the host for the gamespy database didn't get replaced by a self-generated IP address unlike the other ones.

The only difference I can see there is that the gamespy address is very long and the others are not??

Have I missed something in the setup?
I don't need to have MySQL installed on this computer to connect to other MySQL servers do I?

-Stu

Hawk552 02-25-2007 22:04

Re: SQLx remote server?
 
The problem is that the sql.cfg hasn't been executed yet. What you have to do is add a delay (something like set_task(0.1...)) to give time for the config to be executed, or you can read it off manually (with read_file and/or the f<x> natives).

Afrow UK 02-26-2007 06:02

Re: SQLx remote server?
 
Are you 100% sure that that is the problem? Because I've tried hard coding in the IP address as well and I get the same problem... I also set amx_sql_host manually in the console before restart many a time. -Stu

Hawk552 02-26-2007 06:51

Re: SQLx remote server?
 
Quote:

Originally Posted by Afrow UK (Post 445755)
Are you 100% sure that that is the problem? Because I've tried hard coding in the IP address as well and I get the same problem... I also set amx_sql_host manually in the console before restart many a time. -Stu

No, that was just supposed to explain the first problem. The other is probably because your host does not have remote access enabled.

Also, all domains (such as hiprmod.net or whatever) get connected to as an IP address. It's basic networking and DNS.

Afrow UK 02-26-2007 06:59

Re: SQLx remote server?
 
But why is it when I use hiprmod.net it tries to connect to 88.104.146.108 instead of 64.22.68.4? 64.22.68.4 is the IP address of hiprmod.net (yes I am aware of DNS) and 88.104.146.108 is my non static IP address of my home computer. The guy who owns hiprmod.net seems to think that remote access is enabled (the host is for developers like myself) as he told me which address will (should) work.

I just tried my plugin on another machine and I have the same problems.

I'm wondering, could my Windows XP firewall be to blame?

-Stu

Hawk552 02-26-2007 07:03

Re: SQLx remote server?
 
Ah, weird. You're using SQL_MakeStdTuple too, so it probably isn't something like that.

Are you sure you tried hardcoding it though? You'd have to not use SQL_MakeStdTuple.


All times are GMT -4. The time now is 00:37.

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