Gameserver cannot access sourcebans database

If you cannot find your specific category above, ask general questions here to one of our thousands of community member. Please note: Official Support is provided via tickets at my.gameservers.com
Post Reply
Kilroy85
GameServers.com Forum Newb
Posts: 2
Joined: Fri Mar 11, 2016 2:49 pm

Gameserver cannot access sourcebans database

Post by Kilroy85 » Mon Mar 28, 2016 1:03 pm

Hello, I have an game server and a webserver through gameservers.

I am attempting to configure sourcebans for my server.

I am able to get the web panel to connect to the game server and ban/etc.

The game server, however, gives me an error that it cannot connect to the database.

I have verified the username, password, and database many times.

I get a Database failure: [1045]: Access denied for user With the username @ ip using password yes.

Code 1045 when looked up says this:

If the error message reads "Can't connect to local MySQL server through socket", you need to find the "sourcebans" section in databases.cfg and change the value of "host" from "localhost" to the path of your mysql.sock file. If you don't know where mysql.sock is located, ask your gameserver host.


Otherwise, most likely your MySQL server does not allow incoming connections from your gameserver. To fix this, you can do either of the following:

Go into your webserver's control panel and check if there's a section called MySQL Access Hosts, Remote MySQL or something named similar. There you can add the IP address mentioned in the error. This is usually the IP of your gameserver, but it can also be slightly different, so make sure you copy and paste it exactly from the error.
The other option is to run the following query on your SourceBans database (for example using phpMyAdmin):
GRANT ALL ON database.* TO 'username'@'ip';
You will have to replace "database" with your SourceBans database name, and "username" and "ip" with those mentioned in the error.


I have added my game servers ip address to the access host.
I was unable to do "GRANT ALL ON mydatabase.* TO the username@the ip I wanted. It would say that my mysql main username - #1044 - Access denied for user 'webserveraccountname'@'localhost' to database 'mydatabase'

Please help, thank you.

Account number 217864

User avatar
Kilocon
No Longer a Newb
Posts: 10
Joined: Thu Jul 21, 2016 10:21 am

Re: Gameserver cannot access sourcebans database

Post by Kilocon » Fri Aug 05, 2016 7:52 pm

Have you figured this out yet?
Last edited by Kilocon on Fri Aug 05, 2016 8:06 pm, edited 1 time in total.

User avatar
Kilocon
No Longer a Newb
Posts: 10
Joined: Thu Jul 21, 2016 10:21 am

Re: Gameserver cannot access sourcebans database

Post by Kilocon » Fri Aug 05, 2016 7:54 pm

I think you have to add % SQL wildcard to the end of ur IP address

Eg. 45.76.87.10--- 45.76.87.%

Ristien
GameServers.com Forum Newb
Posts: 1
Joined: Fri Jan 05, 2018 4:48 am

Re: Gameserver cannot access sourcebans database

Post by Ristien » Mon Jan 08, 2018 3:40 am

Kilocon wrote:I think you have to add % SQL wildcard to the end of ur IP address

Eg. 45.76.87.10--- 45.76.87.%
Hi Kilocon, same issue and I tried adding % to the end but it didn't do anything. Did you find anything else that works?

annashetty
GameServers.com Forum Newb
Posts: 1
Joined: Wed Sep 27, 2017 10:47 pm

Re: Gameserver cannot access sourcebans database

Post by annashetty » Thu Aug 02, 2018 1:42 am

I myself faced this difficulty, I will also wait for the answer

Post Reply