AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   SourceBans / SourceBans++ (https://forums.alliedmods.net/forumdisplay.php?f=152)
-   -   Can't connect to local MySQL server through socket '/tmp/mysql.sock' (https://forums.alliedmods.net/showthread.php?t=316833)

benmassey 06-12-2019 15:45

Can't connect to local MySQL server through socket '/tmp/mysql.sock'
 
hey guys, I hope someone can help me here, so I've installed a new server in my new dedicated server
everything works just fine except sourceban I'm using version 1.6.3 with theme star,
I'm using centos 7.2
php7.2 (web)

Description:

when I try to set admin, the web gives me success message
but when I check in logs I see that error:

Sourceban error:

PHP Code:

L 06/12/2019 20:34:35: [sbpp_main.smxDatabase failure: [2002]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2). See Docs: https://sbpp.github.io/docs/ 

Error log:
PHP Code:

L 06/12/2019 20:34:54: [SMException reportedInvalid database Handle 0 (error4)
L 06/12/2019 20:34:54: [SMBlamingsbpp_sleuth.smx
L 06
/12/2019 20:34:54: [SMCall stack trace:
L 06/12/2019 20:34:54: [SM]   [0SQL_TQuery
L 06
/12/2019 20:34:54: [SM]   [1Line 170D:\MegaSync\Projects\Sourcemod\scripting\sbpp_sleuth.sp::OnClientPostAdminCheck
L 06
/12/2019 20:34:54: [sbpp_comms.smxConnecting to database failed: [2002]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) 


I tried to log in to MySQL throw terminal and I succeed to log in...


what I tried to do to fix that:

change soket (socket=/var/lib/mysql/mysql.sock)
open port for mysql (3306)
restart service

DarkDeviL 06-13-2019 07:46

Re: Can't connect to local MySQL server through socket '/tmp/mysql.sock'
 
Try changing the host in your databases.cfg file to use the IP address instead.

You're most likely using the hostname (e.g. "localhost") in the cfg, in that case, change to the IP version of "127.0.0.1" instead.

benmassey 06-13-2019 17:31

Re: Can't connect to local MySQL server through socket '/tmp/mysql.sock'
 
Quote:

Originally Posted by DarkDeviL (Post 2655413)
Try changing the host in your databases.cfg file to use the IP address instead.

You're most likely using the hostname (e.g. "localhost") in the cfg, in that case, change to the IP version of "127.0.0.1" instead.


the MYSQL server is from another host..

DarkDeviL 06-14-2019 09:46

Re: Can't connect to local MySQL server through socket '/tmp/mysql.sock'
 
Quote:

Originally Posted by benmassey (Post 2655463)
the MYSQL server is from another host..

Quote:

Originally Posted by benmassey (Post 2655359)
Database failure: [2002]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2).

^

Then configure your game server / systems properly to run through that that non-local "another host" server, ...


All times are GMT -4. The time now is 21:50.

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