View Single Post
Author Message
elfenlied ftw
Member
Join Date: Aug 2012
Old 10-08-2016 , 22:40   Connection issues
Reply With Quote #1

I am having difficulty getting sourcebans 1.5.4.7 to work. My issue is with the game module failing to connect to the database. I am running Centos 7.2.

sourcebans.log:
Code:
L 10/09/2016 - 02:00:52: [sourcebans.smx] Database failure: [2002]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2). See FAQ: https://sarabveer.github.io/SourceBans-Fork/faq/
The link above is a 404.

errors_20161009.log:
Code:
L 10/09/2016 - 02:00:43: Error log file session closed.
L 10/09/2016 - 02:00:52: SourceMod error session started
L 10/09/2016 - 02:00:52: Info (map "ctf_2fort") (file "errors_20161009.log")
L 10/09/2016 - 02:00:52: [SM] Exception reported: Failed to connect to SourceBans DB, [2002]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
L 10/09/2016 - 02:00:52: [SM] Blaming: sbchecker.smx
L 10/09/2016 - 02:00:52: [SM] Call stack trace:
L 10/09/2016 - 02:00:52: [SM]   [0] SetFailState
L 10/09/2016 - 02:00:52: [SM]   [1] Line 76, sbchecker.sp::OnDatabaseConnected
L 10/09/2016 - 02:00:58: [SM] Exception reported: Invalid database Handle 0 (error: 4)
L 10/09/2016 - 02:00:58: [SM] Blaming: SourceSleuth.smx
L 10/09/2016 - 02:00:58: [SM] Call stack trace:
L 10/09/2016 - 02:00:58: [SM]   [0] SQL_TQuery
L 10/09/2016 - 02:00:58: [SM]   [1] Line 168, SourceSleuth.sp::OnClientPostAdminCheck
L 10/09/2016 - 02:00:58: [sourcecomms.smx] Connecting to database failed: [2002]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
databases.cfg:
Code:
"sourcebans"
	{
		"driver"			"mysql"
		"host"				"/var/lib/mysql/mysql.sock"
		"database"			"sourcebans"
		"user"				"sbuser"
		"pass"				"*redacted*"
		//"timeout"			"0"
		"port"			"3306"
	}
I have tried using 127.0.0.1, localhost, /var/lib/mysql/mysql.sock, and /tmp/mysql.sock (which I linked). None of these have worked.


/etc/my.cnf.d/server.cnf
Code:
[mysqld]
port = 3306
bind-address = 0.0.0.0 # have tried 127.0.0.1 too, no effect
max_allowed_packet=16M
socket=/var/lib/mysql/mysql.sock
datadir=/var/lib/mysql/
user=mysql
group=mysql
permissions for /var/lib/mysql and /var/lib/mysql/mysql.sock
these are default and I have not changed these:
Code:
[root@vps ~]# stat /var/lib/mysql
  File: ‘/var/lib/mysql’
  Size: 4096            Blocks: 8          IO Block: 4096   directory
Device: ca02h/51714d    Inode: 262724      Links: 9
Access: (0755/drwxr-xr-x)  Uid: (   27/   mysql)   Gid: (   27/   mysql)
Access: 2016-10-08 20:04:10.399968916 -0500
Modify: 2016-10-08 20:52:32.376776572 -0500
Change: 2016-10-08 20:52:32.376776572 -0500
 Birth: -
 
 
[root@vps ~]# stat /var/lib/mysql/mysql.sock
  File: ‘/var/lib/mysql/mysql.sock’
  Size: 0               Blocks: 0          IO Block: 4096   socket
Device: ca02h/51714d    Inode: 262549      Links: 1
Access: (0777/srwxrwxrwx)  Uid: (   27/   mysql)   Gid: (   27/   mysql)
Access: 2016-10-08 20:52:33.203781669 -0500
Modify: 2016-10-08 20:52:32.376776572 -0500
Change: 2016-10-08 20:52:32.376776572 -0500
 Birth: -
I have manually logged in to mysql to verify the username and password work, and they do.
Code:
[root@vps ~]# mysql -usbuser -p*redacted*
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 5.5.50-MariaDB MariaDB Server

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use sourcebans;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [sourcebans]> show tables;
+--------------------------+
| Tables_in_sourcebans     |
+--------------------------+
| sb_admins                |
| sb_admins_servers_groups |
| sb_banlog                |
| sb_bans                  |
| sb_comments              |
| sb_comms                 |
| sb_demos                 |
| sb_groups                |
| sb_log                   |
| sb_mods                  |
| sb_overrides             |
| sb_protests              |
| sb_servers               |
| sb_servers_groups        |
| sb_settings              |
| sb_srvgroups             |
| sb_srvgroups_overrides   |
| sb_submissions           |
+--------------------------+
18 rows in set (0.00 sec)

MariaDB [sourcebans]> exit
Bye



I have no idea what I'm doing wrong here. I tried everything I listed above to no avail. I tried searching these forums and google and found nothing but people saying to search (pretty ironic, huh?). I have also tried adding an exception in firewalld which had no effect. Any assistance would be appreciated.



Thanks in advance.
elfenlied ftw is offline