Raised This Month: $51 Target: $400
 12% 

MySQL using /var/run/mysqld/mysqld.sock instead of /tmp/mysql.sock


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
waylaidwanderer
SourceMod Donor
Join Date: Aug 2012
Old 08-28-2012 , 00:43   MySQL using /var/run/mysqld/mysqld.sock instead of /tmp/mysql.sock
Reply With Quote #1

I've been trying to configure SourceBans all day and trying to fix this, but it's not working for me.

It keeps looking for /tmp/mysql.sock in that directory but the latest MySQL server puts the sock in /var/run/mysqld/mysqld.sock instead. How can I tell SourceBans (or heck, any plugin that uses MySQL) to use this socket instead? If I change the sockets in my.cnf to /tmp/mysql.sock it breaks the web interface of SourceBans because it attempts to connect through /var/run/mysqld/mysqld.sock.

Any solutions? Thanks in advance.

EDIT: I have fixed this problem by doing something seemingly unrelated: setting bind-ip to localhost instead of the default 127.0.0.1

Anyway, now that I've solved it, I have another question to ask.

Is it possible to use SourceBans on multiple servers from the same SRCDS installation? I know there's a Server ID I have to set in the config file but I don't see a way of doing this unless I can specify a different config file for SourceBans to use.

Last edited by waylaidwanderer; 08-28-2012 at 00:59.
waylaidwanderer is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 08-28-2012 , 11:00   Re: MySQL using /var/run/mysqld/mysqld.sock instead of /tmp/mysql.sock
Reply With Quote #2

I solved your first problem by putting the socket location as the hostname in databases.cfg.

As for the second, you should always have one SourceMod directory per server, though one SRCDS for all is fine. So having one ServerID would be easily done.

I have one of my boxes set up as:
  • tf/addons/
    • sourcemod1
    • sourcemod2
    • sourcemod3
__________________
11530 is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 08-28-2012 , 14:23   Re: MySQL using /var/run/mysqld/mysqld.sock instead of /tmp/mysql.sock
Reply With Quote #3

You can normally tell the mysql driver to not use a unix socket, but a TCP socket instead by setting the mysql host to 127.0.0.1 instead of "localhost" in the databases.cfg.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
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 15:49.


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