Connecting to SQL database
-
- Compulsive poster
- Posts: 66
- https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
- Joined: Fri Nov 07, 2014 8:58 am
Connecting to SQL database
So, I've installed amxbans on my server and for some reason it just will not connect to the DB.
I have an exact replica of the server at home and when I used the same config it works fine.
Here are my settings. (relevant parts only)
amxbans.cfg
// AMXBans tries to get the address from the server automatically.
// You can set a different one here - ex. "<ip>:<port>"
amxbans_server_address "64.94.238.61:27015"
plugins.ini
amxbans_core.amxx
amxbans_main.amxx
variable-friendly.amxx
; AMX Mod X plugins
; Admin Base - Always one has to be activated
;admin.amxx ; admin base (required for any admin-related)
admin_sql.amxx ; admin base - SQL version (comment admin.amxx)
sql.cfg
// SQL configuration file
// File location: $moddir/addons/amxmodx/configs/sql.cfg
// *NOTE* Linux users may encounter problems if they specify "localhost" instead of "127.0.0.1"
// We recommend using your server IP address instead of its name
// *NOTE* amx_sql_type specifies the DEFAULT database type which admin.sma will use.
amx_sql_host "74.220.215.100"
amx_sql_user "therobo2_kab"
amx_sql_pass "*****"
amx_sql_db "therobo2_amxbansdb"
amx_sql_table "admins"
amx_sql_type "mysql"
I've added the nfo server to the whitelist in my DB hosting cpanel, this is the ip I used 64.94.238.61
I'm at a loss as what to do next.
Thanks
I have an exact replica of the server at home and when I used the same config it works fine.
Here are my settings. (relevant parts only)
amxbans.cfg
// AMXBans tries to get the address from the server automatically.
// You can set a different one here - ex. "<ip>:<port>"
amxbans_server_address "64.94.238.61:27015"
plugins.ini
amxbans_core.amxx
amxbans_main.amxx
variable-friendly.amxx
; AMX Mod X plugins
; Admin Base - Always one has to be activated
;admin.amxx ; admin base (required for any admin-related)
admin_sql.amxx ; admin base - SQL version (comment admin.amxx)
sql.cfg
// SQL configuration file
// File location: $moddir/addons/amxmodx/configs/sql.cfg
// *NOTE* Linux users may encounter problems if they specify "localhost" instead of "127.0.0.1"
// We recommend using your server IP address instead of its name
// *NOTE* amx_sql_type specifies the DEFAULT database type which admin.sma will use.
amx_sql_host "74.220.215.100"
amx_sql_user "therobo2_kab"
amx_sql_pass "*****"
amx_sql_db "therobo2_amxbansdb"
amx_sql_table "admins"
amx_sql_type "mysql"
I've added the nfo server to the whitelist in my DB hosting cpanel, this is the ip I used 64.94.238.61
I'm at a loss as what to do next.
Thanks
-
- Compulsive poster
- Posts: 66
- Joined: Fri Nov 07, 2014 8:58 am
Re: Connecting to SQL database
This is the error I'm seeing
L 01/17/2015 - 18:56:21: [amxbans_main.amxx] [AMXBans] Connection failed!
L 01/17/2015 - 18:56:21: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 17
L 01/17/2015 - 18:56:21: [amxbans_main.amxx] [AMXBans] Message: Can't connect to MySQL server on '74.220.215.100' (10060) (2003)
L 01/17/2015 - 18:56:21: [amxbans_main.amxx] [AMXBans] Connection failed!
L 01/17/2015 - 18:56:21: [amxbans_main.amxx] [AMXBans] Threaded Query Error, Place: 17
L 01/17/2015 - 18:56:21: [amxbans_main.amxx] [AMXBans] Message: Can't connect to MySQL server on '74.220.215.100' (10060) (2003)
Re: Connecting to SQL database
Looks like you are using shared hosting for your database.
Have you double checked that the game server IP is white listed in remote mysql? Even if you have the game server IP there, it is likely that your game server is using the primary machine IP to try to connect(which you wouldn't know). You can check the mysql server logs to find failed logins from NFO IPs, review game server logs to see if you have an error like this:
Connection to SQL database has failed, Reason: [1045]: Access denied for user 'mysql_user'@'c-66-150-188-219.internap-la.nfoservers.com' (using password: YES)
in your amx logs(above is sourcemod error logs).
If you still can't find the IP, open a ticket and ask for the primary machine IP. The ticket may need to be escalated to John.
Have you double checked that the game server IP is white listed in remote mysql? Even if you have the game server IP there, it is likely that your game server is using the primary machine IP to try to connect(which you wouldn't know). You can check the mysql server logs to find failed logins from NFO IPs, review game server logs to see if you have an error like this:
Connection to SQL database has failed, Reason: [1045]: Access denied for user 'mysql_user'@'c-66-150-188-219.internap-la.nfoservers.com' (using password: YES)
in your amx logs(above is sourcemod error logs).
If you still can't find the IP, open a ticket and ask for the primary machine IP. The ticket may need to be escalated to John.
Not a NFO employee
-
- Compulsive poster
- Posts: 66
- Joined: Fri Nov 07, 2014 8:58 am
Re: Connecting to SQL database
Thanks Soja,
This is immensely useful!
They're contacting the CEO to get the primary machine ID.
I'm also going to install the DB on one of NFO webservers as I'm going to assume that they've whitelisted themselves
Thanks again
This is immensely useful!
They're contacting the CEO to get the primary machine ID.
I'm also going to install the DB on one of NFO webservers as I'm going to assume that they've whitelisted themselves
Thanks again
Re: Connecting to SQL database
NFOs web/sql is configured a little differently from cPanel, NFO has a checkbox to "allow external hosts" which will allow all remote hosts to connect.
You're welcome
You're welcome
Not a NFO employee
-
- Compulsive poster
- Posts: 66
- Joined: Fri Nov 07, 2014 8:58 am
Re: Connecting to SQL database
I used the nfoservers web SQL db, worked a treat.
Funny thing is that my home servers are not populating data the same way the nfo server is (although they're both working great)
Any ideas?
Thanks
Funny thing is that my home servers are not populating data the same way the nfo server is (although they're both working great)
Any ideas?
Thanks
-
- Compulsive poster
- Posts: 66
- Joined: Fri Nov 07, 2014 8:58 am
Re: Connecting to SQL database
the SQL db is the nfo one, and one (the working one) of the game servers is nfo but the other two (connecting but not showing details) are my home/test servers.
-
- Compulsive poster
- Posts: 66
- Joined: Fri Nov 07, 2014 8:58 am
Re: Connecting to SQL database
wait, you might be right (again), any idea what port I should be forwarding?
Thanks
Thanks
-
- Compulsive poster
- Posts: 66
- Joined: Fri Nov 07, 2014 8:58 am
Re: Connecting to SQL database
I already have those ports forwarded so players can connect from the net.
I thought you meant different ports. I'll keep messing with the settings see what I can come up with
Thanks again
I thought you meant different ports. I'll keep messing with the settings see what I can come up with
Thanks again
-
- Compulsive poster
- Posts: 66
- Joined: Fri Nov 07, 2014 8:58 am
Re: Connecting to SQL database
Sorted it
I had my DDNS in the amxbans.cfg file, when I swapped it out for the actual IP it worked.
Shouldn't make a difference but I guess it did
I had my DDNS in the amxbans.cfg file, when I swapped it out for the actual IP it worked.
Shouldn't make a difference but I guess it did