mysqloo - Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

So im getting this error with mysqloo when trying to connect to the database:

 Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

thats the only error it gives. Using Ubuntu Server 12.04.
Any idea what might cause this or how to fix?

Also the file seems to be built for ubuntu server 11.04, could this cause the problem? If so how would i build it for the new version?

I’m having the same issue

Check /tmp/mysql.sock exists and the user srcds is running as has access

Mine doesn’t exists and I’ve no idea where it else could be?

Not all distributions have their socket in that location. For example on my server it’s under “/var/run/mysqld/mysqld.sock”

Hence why I made it an optional argument to set the path in tmysql4.

/tmp/mysql.sock was a link to /var/run/mysqld/mysqld.sock for me, I assumed that it was a standard thing (it’s the default socket location for PHP too) to deal with the ambiguity caused from different installation directories on different distros. You can use it after the port on mysqloo to use your own.

[lua]self.MySQL = mysqloo.connect( self.Host, self.User, self.Pass, self.Name, self.Port, self.Sock )[/lua]