LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-29-2010, 05:37 AM   #1
hctopcu
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Rep: Reputation: 0
mysql cannot connect socket but fine through TCP/IP


I'm using mysql server through tcp/ip with no problem. But I don't know since when I'm not able to connect through socket. There are lots of topics but my bad I couldn't find one works for me.

OS: Ubuntu 9.04
mysql 5.0.75-0ubuntu10.5


my.cnf
Quote:
[mysqld]
user = mysql
socket = /var/run/mysqld/mysqld.sock

skip-name-resolve
safe-show-database
#old_passwords
back_log = 50
skip-innodb
max_connections = 800
key_buffer_size = 1024M
myisam_sort_buffer_size = 128M
join_buffer_size = 3M
read_buffer_size = 3M
sort_buffer_size = 8M
table_cache = 8000
thread_cache_size = 768
wait_timeout = 60
connect_timeout = 10
tmp_table_size = 144M
max_heap_table_size = 144M
max_allowed_packet = 64M
net_buffer_length = 16384
max_connect_errors = 10
thread_concurrency = 16
concurrent_insert = 2
table_lock_wait_timeout = 30
read_rnd_buffer_size = 786432
bulk_insert_buffer_size = 8M
query_cache_limit = 6M
query_cache_size = 288M
query_cache_type = 1
query_prealloc_size = 262144
query_alloc_block_size = 65536
transaction_alloc_block_size = 8192
transaction_prealloc_size = 4096
default-storage-engine = MyISAM
max_write_lock_count = 16

[mysqld_safe]
nice = -10
open_files_limit = 8192

[mysqldump]
quick
max_allowed_packet = 16M

[myisamchk]
key_buffer = 1024M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
!includedir /etc/mysql/conf.d/
/var/run/mysqld/mysqld.sock socket exists and has chmod 777
Error:
Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket 'localhost' (2)
 
Old 07-29-2010, 08:23 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hi

Not really sure, but it looks like that last error message comes from a client trying to connect to a socket named "localhost". The clients can also read my.cnf, but look for a section called "client". Add this to my.cnf:

[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock

This is from the default my.cnf. Did you remove the client section in it?
 
Old 07-29-2010, 08:36 AM   #3
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Explain what you mean by you can connect with TCP/IP and not sockets?

Use 'netstat -anp | grep LISTEN' and check to see if mysqld is listening. How are you trying to connect?
 
Old 08-06-2010, 05:03 AM   #4
hctopcu
LQ Newbie
 
Registered: Jul 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Hi;
Just after an update, I fired a reboot. The problem was dissapeared. I could'nt trace it. Thanks for the advices though.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 02:13 PM
i want to connect mysql server from remote through TCP/IP not by unix socket dheerajjss Linux - Newbie 1 11-10-2008 06:32 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. SpellChainz Linux - Newbie 1 06-23-2007 03:35 PM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 08:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration