Raised This Month: $ Target: $400
 0% 

SQLx remote server?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Afrow UK
Junior Member
Join Date: Feb 2007
Old 02-25-2007 , 17:15   SQLx remote server?
Reply With Quote #1

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
Afrow UK is offline
MaximusBrood
Veteran Member
Join Date: Sep 2005
Location: The Netherlands
Old 02-25-2007 , 17:17   Re: SQLx remote server?
Reply With Quote #2

It's perfectly possible to use a remote SQL server.
Show your code so we can see what you're doing wrong
__________________
Released six formerly private plugins. Not active here since ages.
MaximusBrood is offline
Afrow UK
Junior Member
Join Date: Feb 2007
Old 02-25-2007 , 17:37   Re: SQLx remote server?
Reply With Quote #3

Here is the source code.
I was using the DBI module before and I had the same problem...

-Stu

Last edited by Afrow UK; 02-25-2007 at 20:42.
Afrow UK is offline
Afrow UK
Junior Member
Join Date: Feb 2007
Old 02-25-2007 , 18:28   Re: SQLx remote server?
Reply With Quote #4

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 is offline
Afrow UK
Junior Member
Join Date: Feb 2007
Old 02-25-2007 , 21:55   Re: SQLx remote server?
Reply With Quote #5

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
Attached Files
File Type: sma Get Plugin or Get Source (ecs.sma - 643 views - 7.8 KB)

Last edited by Afrow UK; 02-25-2007 at 22:01.
Afrow UK is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-25-2007 , 22:04   Re: SQLx remote server?
Reply With Quote #6

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).
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Afrow UK
Junior Member
Join Date: Feb 2007
Old 02-26-2007 , 06:02   Re: SQLx remote server?
Reply With Quote #7

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

Last edited by Afrow UK; 02-26-2007 at 06:06.
Afrow UK is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-26-2007 , 06:51   Re: SQLx remote server?
Reply With Quote #8

Quote:
Originally Posted by Afrow UK View Post
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.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Afrow UK
Junior Member
Join Date: Feb 2007
Old 02-26-2007 , 06:59   Re: SQLx remote server?
Reply With Quote #9

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
Afrow UK is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 02-26-2007 , 07:03   Re: SQLx remote server?
Reply With Quote #10

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.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
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 00:37.


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