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

Mysql Socket Problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
BlackPearl
New Member
Join Date: Feb 2012
Old 02-07-2012 , 13:42   Mysql Socket Problem
Reply With Quote #1

Hello everybody. I've got a problem with linux counter strike servers - when i try to use mysql on any server - i got this error:

Message: Can't Connect To local Mysql Server through socket '/tmp/mysql.sock' (2) (2002)

Anyone can tell me how i can change the directory of this socket, and how i can set the apache's socket work on the new socket directory?

Thanks, and sorry for bad English.. xD
BlackPearl is offline
alexinno
Senior Member
Join Date: Mar 2007
Location: C:\
Old 02-10-2012 , 05:38   Re: Mysql Socket Problem
Reply With Quote #2

look for mysql.sock and create a symlink in /tmp
you can find the path for mysql.sock in my.cnf

you should provide more info on your configuration like
distro , version , architecture
mysql installed , started
__________________

[IMG]http://img188.**************/img188/5787/banner2rcw.png[/IMG]
alexinno is offline
Scherzo
Senior Member
Join Date: Feb 2007
Location: Kwidzyn, Poland
Old 02-10-2012 , 10:24   Re: Mysql Socket Problem
Reply With Quote #3

Try other form of ip like:
127.0.0.1
localhost
192.168.0.x

finally public server ip (if available)

Last edited by Scherzo; 02-10-2012 at 10:24.
Scherzo is offline
BlackPearl
New Member
Join Date: Feb 2012
Old 02-10-2012 , 11:22   Re: Mysql Socket Problem
Reply With Quote #4

Hi again. I use last version of Debian. i installed mysql using this command:

sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql

In every reinstall of linux i got this problem with mysql, and now im determined to fix it.

My configuration in my.cfg file have default settings:

Quote:
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/se...variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0

[mysqld]
#
# * Basic Settings
#
user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp
language = /usr/share/mysql/english
skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address = 127.0.0.1
#
# * Fine Tuning
#
key_buffer = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover = BACKUP
#max_connections = 100
#table_cache = 64
#thread_concurrency = 10
#
# * Query Cache Configuration
#
query_cache_limit = 1M
query_cache_size = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file = /var/log/mysql/mysql.log
#general_log = 1
#
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
#
# Here you can see queries with especially long duration
#log_slow_queries = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
# other settings you may need to change.
#server-id = 1
#log_bin = /var/log/mysql/mysql-bin.log
expire_logs_days = 10
max_binlog_size = 100M
#binlog_do_db = include_database_name
#binlog_ignore_db = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition

[isamchk]
key_buffer = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
# The files must end with '.cnf', otherwise they'll be ignored.
#
!includedir /etc/mysql/conf.d/
Thanks again, and i will ask to tell me anythink ...

In my.cnf i see very much fields with "Socket" and they are all in /var/run/mysqld/mysqld.sock (noone with mysql.sock)

When i try to do this command "sudo ln-s /var/run/mysqld/mysqld.sock /tmp/mysql.sock file was changed to new dir, but again server cant connect with the socket (again this problem :X)

Edit: I can public server ip, but it will be advertising. If u wanna to see anythink in the server about this problem pm me to give u the IP

Last edited by BlackPearl; 02-10-2012 at 11:27.
BlackPearl is offline
wickedd
Veteran Member
Join Date: Nov 2009
Old 02-10-2012 , 11:54   Re: Mysql Socket Problem
Reply With Quote #5

This forum is for issues with AMX MOD X, so post your problem in the correct forum.
__________________
Just buy the fucking game!!!!
I hate No-Steamers and lazy ass people.
wickedd is offline
alexinno
Senior Member
Join Date: Mar 2007
Location: C:\
Old 02-11-2012 , 01:12   Re: Mysql Socket Problem
Reply With Quote #6

is your hlds server on the same machine with the mysql server ?
what's the output of the command
Code:
netstat -npl | grep mysql
what is the contents of sql.cfg (without password) ?
if you have
Code:
amx_sql_host    "localhost"
that's most likely the problem , it should be
Code:
amx_sql_host    "127.0.0.1"
but the simlynk should also have solved your problem
Code:
ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
__________________

[IMG]http://img188.**************/img188/5787/banner2rcw.png[/IMG]

Last edited by alexinno; 02-11-2012 at 02:22.
alexinno is offline
Old 02-14-2012, 20:34
Macense98
This message has been deleted by Exolent[jNr]. Reason: Spambot
Rockinz
Member
Join Date: Jan 2013
Old 01-20-2013 , 12:56   Re: Mysql Socket Problem
Reply With Quote #7

Where do i find those commands alxinno? I got the same problem as blackpearl.
Rockinz is offline
jonnzus
Epic Member
Join Date: Oct 2010
Location: Finland
Old 01-20-2013 , 13:15   Re: Mysql Socket Problem
Reply With Quote #8

Imo that does mean that ur plugin cant find ur mysql server.
Code:
Message: Can't Connect To local Mysql Server through socket '/tmp/mysql.sock' (2) (2002)
Type that to terminal, and look is mysql server running.
sudo service mysql status
if it ain't running u can start it with
sudo service mysql start

And put those commands to terminal.
__________________
Quote:
367. Everyone's copyright will be broken. No exceptions.

Last edited by jonnzus; 01-20-2013 at 13:16.
jonnzus is offline
Rockinz
Member
Join Date: Jan 2013
Old 01-20-2013 , 14:21   Re: Mysql Socket Problem
Reply With Quote #9

Got this respond: You will need to setup the sql database on an alternative host. It can not be running on the game server it self.

How do I do that ?
Rockinz 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 21:05.


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