LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-04-2004, 04:04 PM   #1
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Rep: Reputation: 33
MySQL can't connect through socket!


Hi I hope someone can help! I've been working on this a solid 2 days.

background info:
System: PII IBM PC300GL with 64 MB RAM and 8 GB hard disk
OS: Mandrake Linux 10.0, kernel 2.6.something
MySQL 4.0.4 that I installed off the Mandrake CD from RPMs.
I have MySQL-client, MySQL-server and MySQL-bench RPMs installed.

I type ./mysql.server start and get [ OK ] response.
I type mysqld_safe --user=mysql & and get "starting with databases ..." (whatever, but it looks like its running).

ps | grep mysqld returns about 20 entries.

So, I guess the server is running properly.

Now, when I type "mysqladmin version" I get this:
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

(according to find, no file with .sock exists on the machine). I tried creating it with vi and touch, and they disappear immediately. Go figure?!?

So I tried bunch of things, ran the mysql_db command to initialise the grants. Didn't help. Rebooted the machine, didn't help. Tried "telnet localhost 3306" and got "telnet: Unable to connect to remote host: Connection refused". "netstat -l | grep mysql" returns nothing.

Why isn't this socket thing working? I also copied my-small.cnf to /etc/my.cnf and in there it says to use socket /var/lib/mysql/mysql.sock, but as I stated, it doesn't exist and can't be created.

What's going on and how can I get this to work??

Thanks in advance.
 
Old 08-04-2004, 04:13 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
In your mysql configuration file "my.cnf" make sure that you have "socket" lines in the following 2 sections:
[client]
socket = /var/lib/mysql/mysql.sock

[mysqld]
socket = /var/lib/mysql/mysql.sock
 
Old 08-04-2004, 04:15 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
Search this entire board for the keywords 'mysql sock'. I got 196 hits on that topic.
 
Old 08-05-2004, 12:38 PM   #4
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Here's my /etc/my.cnf (which I had to create, using the example provided my-small.cnf)
Please, tell me where the modifications are needed!

Code:
[client]
port            = 3306
socket          = /var/lib/mysql/mysql.sock

[mysqld]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16K
max_allowed_packet = 1M
table_cache = 4
sort_buffer_size = 64K
net_buffer_length = 2K
thread_stack = 64K
server-id       = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
safe-updates

[isamchk]
key_buffer = 8M
sort_buffer_size = 8M

[myisamchk]
key_buffer = 8M
sort_buffer_size = 8M

[mysqlhotcopy]
interactive-timeout
bigrigdriver, I have done a search, but other's solutions are not working for me. I will continue to search though. thanks.

Last edited by Avatar; 08-05-2004 at 12:42 PM.
 
Old 08-05-2004, 01:24 PM   #5
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Here is some additinoal info that I hope will help you help me!!

1. TCP/IP doesn't work either it seems.
Code:
[root@78-XX033 mysql]$ mysqladmin version -h 127.0.0.1
mysqladmin: connect to server at '127.0.0.1' failed
error: 'Lost connection to MySQL server during query'
2. The process is running. (many many many of them)
Code:
[root@78-XX033 mysql]$ ps | grep mysql
 3026 pts0     00:00:00 mysqld_safe
 3047 pts0     00:00:00 mysqld
 3082 pts0     00:00:00 mysqld
 3120 pts0     00:00:00 mysqld
 3161 pts0     00:00:00 mysqld
 3205 pts0     00:00:00 mysqld
 3252 pts0     00:00:00 mysqld
 3302 pts0     00:00:00 mysqld
 3355 pts0     00:00:00 mysqld
 3411 pts0     00:00:00 mysqld
 3470 pts0     00:00:00 mysqld
 3532 pts0     00:00:00 mysqld
 3597 pts0     00:00:00 mysqld
 3665 pts0     00:00:00 mysqld
 3736 pts0     00:00:00 mysqld
 3810 pts0     00:00:00 mysqld
 3887 pts0     00:00:00 mysqld
 3967 pts0     00:00:00 mysqld
 4050 pts0     00:00:00 mysqld
 4136 pts0     00:00:00 mysqld
 4225 pts0     00:00:00 mysqld
 4317 pts0     00:00:00 mysqld
 4412 pts0     00:00:00 mysqld
 4510 pts0     00:00:00 mysqld
 4611 pts0     00:00:00 mysqld
 4715 pts0     00:00:00 mysqld
 4822 pts0     00:00:00 mysqld
 4932 pts0     00:00:00 mysqld
 5045 pts0     00:00:00 mysqld
 5161 pts0     00:00:00 mysqld
 5280 pts0     00:00:00 mysqld
 5402 pts0     00:00:00 mysqld
 5527 pts0     00:00:00 mysqld
 5655 pts0     00:00:00 mysqld
 5786 pts0     00:00:00 mysqld
 5920 pts0     00:00:00 mysqld
 6057 pts0     00:00:00 mysqld
 6197 pts0     00:00:00 mysqld
 6341 pts0     00:00:00 mysqld
 6496 pts0     00:00:00 mysqld
 6645 pts0     00:00:00 mysqld
 6797 pts0     00:00:00 mysqld
 6952 pts0     00:00:00 mysqld
 7110 pts0     00:00:00 mysqld
 7271 pts0     00:00:00 mysqld
 7436 pts0     00:00:00 mysqld
 7603 pts0     00:00:00 mysqld
 7773 pts0     00:00:00 mysqld
 7946 pts0     00:00:00 mysqld
 8122 pts0     00:00:00 mysqld
 8301 pts0     00:00:00 mysqld
 8483 pts0     00:00:00 mysqld
 8668 pts0     00:00:00 mysqld
 8856 pts0     00:00:00 mysqld
 9047 pts0     00:00:00 mysqld
 9241 pts0     00:00:00 mysqld
 9438 pts0     00:00:00 mysqld
 9638 pts0     00:00:00 mysqld
 9841 pts0     00:00:00 mysqld
10047 pts0     00:00:00 mysqld
10256 pts0     00:00:00 mysqld
10468 pts0     00:00:00 mysqld
10683 pts0     00:00:00 mysqld
10911 pts0     00:00:00 mysqld
11132 pts0     00:00:00 mysqld
11356 pts0     00:00:00 mysqld
11583 pts0     00:00:00 mysqld
11813 pts0     00:00:00 mysqld
12046 pts0     00:00:00 mysqld
12284 pts0     00:00:00 mysqld
12523 pts0     00:00:00 mysqld
12765 pts0     00:00:00 mysqld
13010 pts0     00:00:00 mysqld
13258 pts0     00:00:00 mysqld
13509 pts0     00:00:00 mysqld
13763 pts0     00:00:00 mysqld
14020 pts0     00:00:00 mysqld
14281 pts0     00:00:00 mysqld
14553 pts0     00:00:00 mysqld
14820 pts0     00:00:00 mysqld
15092 pts0     00:00:00 mysqld
15364 pts0     00:00:00 mysqld
15639 pts0     00:00:00 mysqld
15917 pts0     00:00:00 mysqld
16198 pts0     00:00:00 mysqld
16482 pts0     00:00:00 mysqld
16769 pts0     00:00:00 mysqld
17068 pts0     00:00:00 mysqld
17361 pts0     00:00:00 mysqld
17657 pts0     00:00:00 mysqld
17956 pts0     00:00:00 mysqld
18258 pts0     00:00:00 mysqld
18563 pts0     00:00:00 mysqld
18871 pts0     00:00:00 mysqld
19183 pts0     00:00:00 mysqld
19497 pts0     00:00:00 mysqld
19814 pts0     00:00:00 mysqld
20134 pts0     00:00:00 mysqld
20461 pts0     00:00:00 mysqld
20792 pts0     00:00:00 mysqld
21121 pts0     00:00:00 mysqld
21455 pts0     00:00:00 mysqld
21790 pts0     00:00:00 mysqld
22128 pts0     00:00:00 mysqld
22469 pts0     00:00:00 mysqld
22814 pts0     00:00:00 mysqld
23161 pts0     00:00:00 mysqld
23511 pts0     00:00:00 mysqld
23744 pts0     00:00:00 mysqld_safe
23898 pts0     00:00:00 mysqld
23899 pts0     00:00:00 mysqld
24299 pts0     00:00:00 mysqld
24300 pts0     00:00:00 mysqld
24539 pts0     00:00:00 mysqld
24670 pts0     00:00:00 mysqld
24759 pts0     00:00:00 mysqld
24812 pts0     00:00:00 mysqld
24834 pts0     00:00:00 mysqld
24939 pts0     00:00:00 mysqld
25040 pts0     00:00:00 mysqld
25147 pts0     00:00:00 mysqld
25402 pts0     00:00:00 mysqld
25410 pts0     00:00:00 mysqld
25538 pts0     00:00:00 mysqld
25675 pts0     00:00:00 mysqld
25803 pts0     00:00:00 mysqld
25937 pts0     00:00:00 mysqld
26089 pts0     00:00:00 mysqld
26145 pts0     00:00:00 mysqld
26240 pts0     00:00:00 mysqld
26383 pts0     00:00:00 mysqld
26538 pts0     00:00:00 mysqld
26708 pts0     00:00:00 mysqld
26897 pts0     00:00:00 mysqld
26898 pts0     00:00:00 mysqld
27259 pts0     00:00:00 mysqld
27458 pts0     00:00:00 mysqld
27459 pts0     00:00:00 mysqld
27753 pts0     00:00:00 mysqld
28031 pts0     00:00:00 mysqld
28051 pts0     00:00:00 mysqld
28242 pts0     00:00:00 mysqld
28460 pts0     00:00:00 mysqld
28684 pts0     00:00:00 mysqld
28788 pts0     00:00:00 mysqld
28919 pts0     00:00:00 mysqld
29194 pts0     00:00:00 mysqld
29449 pts0     00:00:00 mysqld
29468 pts0     00:00:00 mysqld
29693 pts0     00:00:00 mysqld
29941 pts0     00:00:00 mysqld
30216 pts0     00:00:00 mysqld
30232 pts0     00:00:00 mysqld
30482 pts0     00:00:00 mysqld
30840 pts0     00:00:00 mysqld
30905 pts0     00:00:00 mysqld
31117 pts0     00:00:00 mysqld
31395 pts0     00:00:00 mysqld
31692 pts0     00:00:00 mysqld
31693 pts0     00:00:00 mysqld
31980 pts0     00:00:00 mysqld
32300 pts0     00:00:00 mysqld
32446 pts0     00:00:00 mysqld
32646 pts0     00:00:00 mysqld
  466 pts0     00:00:00 mysqld
  773 pts0     00:00:00 mysqld
  774 pts0     00:00:00 mysqld
 1145 pts0     00:00:00 mysqld
 1473 pts0     00:00:00 mysqld
 1534 pts0     00:00:00 mysqld
 1838 pts0     00:00:00 mysqld
 2184 pts0     00:00:00 mysqld
 2361 pts0     00:00:00 mysqld
 2510 pts0     00:00:00 mysqld
 2900 pts0     00:00:00 mysqld
 3178 pts0     00:00:00 mysqld
 3276 pts0     00:00:00 mysqld
 3648 pts0     00:00:00 mysqld
 4009 pts0     00:00:00 mysqld
 4017 pts0     00:00:00 mysqld
 4559 pts0     00:00:00 mysqld
 4679 pts0     00:00:00 mysqld
 4945 pts0     00:00:00 mysqld
 5291 pts0     00:00:00 mysqld
 5580 pts0     00:00:00 mysqld
 5612 pts0     00:00:00 mysqld
I've been stopping the processes with killall -9 mysqld, and restarting them, also starting and stopping the server, rebooting, etc... no avail.

This mysql.sock file won't create.

Code:
[root@78-XX033 bin]$ ls -alh /var/lib/mysql
total 40K
drwxrwxrwx   4 mysql  mysql  4.0K Aug  5 14:05 ./
drwxr-xr-x  16 root   root   4.0K Aug  3 14:00 ../
-rw-rw----   1 mysql mysql  22K Aug  5 14:19 78-XX033.lchras.workstart-lchras.ca.err
drwx--x--x   2 mysql  mysql  4.0K Feb 23 06:01 mysql/
drwxr-xr-x   2 mysql  mysql  4.0K Feb 23 06:02 test/
I made SURE it wasn't a permissions issue. In fact, I keep deleting the 78-XX....err file and it keeps coming back. So I don't know why the sock file isn't being created?!?!?!?!?!
 
Old 08-05-2004, 02:07 PM   #6
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
hmm - you have a lot of mysqld processes.

Try running:
service mysqld stop
service mysqld stop

Then wait a few seconds and run:
killall mysqld

Retry the last command until you get "no process killed". Then start it again:
service mysqld start

You can then try to connect. If it fails then can you post the output from:
netstat -nlp
 
Old 08-05-2004, 02:55 PM   #7
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Hi david_ross, thanks for helping.

$ service mysqld stop
Cannot find mysqld service
Usage: service -[Rfshv] SERVICE ARGUMENTS

[root@78-XX033 mysql]# killall -9 mysqld
[root@78-XX033 mysql]# killall mysqld
mysqld: no process killed

[root@78-XX033 mysql]# service mysqld start
Cannot find mysqld service

[root@78-XX033 mysql]# cd /usr/share/mysql
[root@78-XX033 mysql]# ./mysql.server start
Starting MySQL Server [ OK ]
[root@78-XX033 mysql]# mysqld_safe --user=mysql
Starting mysqld daemon with databases from /var/lib/mysql

[root@78-XX033 mysql]# ps -a | grep mysql
26730 pts0 00:00:00 mysqld_safe
26759 pts0 00:00:00 mysqld
26799 pts0 00:00:00 mysqld
26842 pts0 00:00:00 mysqld
26888 pts0 00:00:00 mysqld
26937 pts0 00:00:00 mysqld
26989 pts0 00:00:00 mysqld
27044 pts0 00:00:00 mysqld
27103 pts0 00:00:00 mysqld
27164 pts0 00:00:00 mysqld
27228 pts0 00:00:00 mysqld
27304 pts0 00:00:00 mysqld
27374 pts0 00:00:00 mysqld
27447 pts0 00:00:00 mysqld
27523 pts0 00:00:00 mysqld
27602 pts0 00:00:00 mysqld
27684 pts0 00:00:00 mysqld
27769 pts0 00:00:00 mysqld
27857 pts0 00:00:00 mysqld
27948 pts0 00:00:00 mysqld
28042 pts0 00:00:00 mysqld
28139 pts0 00:00:00 mysqld
28170 pts0 00:00:00 mysqld_safe
28211 pts0 00:00:00 mysqld
28287 pts0 00:00:00 mysqld
28321 pts0 00:00:00 mysqld
28367 pts0 00:00:00 mysqld
28461 pts0 00:00:00 mysqld
28531 pts0 00:00:00 mysqld
28556 pts0 00:00:00 mysqld
28656 pts0 00:00:00 mysqld
28744 pts0 00:00:00 mysqld
28757 pts0 00:00:00 mysqld
28872 pts0 00:00:00 mysqld
28972 pts0 00:00:00 mysqld
28997 pts0 00:00:00 mysqld
29118 pts0 00:00:00 mysqld
29209 pts0 00:00:00 mysqld
29244 pts0 00:00:00 mysqld
29412 pts0 00:00:00 mysqld
29413 pts0 00:00:00 mysqld
29573 pts0 00:00:00 mysqld
29643 pts0 00:00:00 mysqld
29719 pts0 00:00:00 mysqld
29879 pts0 00:00:00 mysqld
29880 pts0 00:00:00 mysqld
30046 pts0 00:00:00 mysqld
30125 pts0 00:00:00 mysqld
30231 pts0 00:00:00 mysqld
30376 pts0 00:00:00 mysqld
30387 pts0 00:00:00 mysqld
30576 pts0 00:00:00 mysqld
30646 pts0 00:00:00 mysqld
30764 pts0 00:00:00 mysqld
30903 pts0 00:00:00 mysqld
30967 pts0 00:00:00 mysqld
31154 pts0 00:00:00 mysqld
31188 pts0 00:00:00 mysqld
31393 pts0 00:00:00 mysqld
31410 pts0 00:00:00 mysqld
31659 pts0 00:00:00 mysqld
31668 pts0 00:00:00 mysqld
31943 pts0 00:00:00 mysqld
31951 pts0 00:00:00 mysqld
32179 pts0 00:00:00 mysqld
32252 pts0 00:00:00 mysqld
32400 pts0 00:00:00 mysqld
32557 pts0 00:00:00 mysqld
32639 pts0 00:00:00 mysqld
405 pts0 00:00:00 mysqld
406 pts0 00:00:00 mysqld
654 pts0 00:00:00 mysqld
712 pts0 00:00:00 mysqld
989 pts0 00:00:00 mysqld
992 pts0 00:00:00 mysqld
1295 pts0 00:00:00 mysqld
1303 pts0 00:00:00 mysqld
1584 pts0 00:00:00 mysqld
1625 pts0 00:00:00 mysqld
1858 pts0 00:00:00 mysqld
2046 pts0 00:00:00 mysqld
2122 pts0 00:00:00 mysqld
2386 pts0 00:00:00 mysqld
2456 pts0 00:00:00 mysqld
2728 pts0 00:00:00 mysqld
2735 pts0 00:00:00 mysqld
3055 pts0 00:00:00 mysqld
3056 pts0 00:00:00 mysqld
3396 pts0 00:00:00 mysqld
3397 pts0 00:00:00 mysqld
3703 pts0 00:00:00 mysqld
3770 pts0 00:00:00 mysqld
4019 pts0 00:00:00 mysqld
4143 pts0 00:00:00 mysqld
4344 pts0 00:00:00 mysqld
4525 pts0 00:00:00 mysqld
4673 pts0 00:00:00 mysqld
4956 pts0 00:00:00 mysqld
4957 pts0 00:00:00 mysqld
5312 pts0 00:00:00 mysqld
5323 pts0 00:00:00 mysqld
5693 pts0 00:00:00 mysqld
5694 pts0 00:00:00 mysqld
6070 pts0 00:00:00 mysqld
6071 pts0 00:00:00 mysqld
6454 pts0 00:00:00 mysqld
6455 pts0 00:00:00 mysqld
6847 pts0 00:00:00 mysqld
6858 pts0 00:00:00 mysqld
7202 pts0 00:00:00 mysqld
7284 pts0 00:00:00 mysqld
7593 pts0 00:00:00 mysqld
7676 pts0 00:00:00 mysqld
8015 pts0 00:00:00 mysqld
8118 pts0 00:00:00 mysqld
8305 pts0 00:00:00 mysqld
8667 pts0 00:00:00 mysqld
8669 pts0 00:00:00 mysqld
9063 pts0 00:00:00 mysqld
9127 pts0 00:00:00 mysqld
9206 pts0 00:00:00 mysqld
9215 pts0 00:00:00 mysqld

[root@78-XX033 mysql]# netstat -nlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:1024 0.0.0.0:* LISTEN 1762/xinetd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1502/portmap
tcp 0 0 :::80 :::* LISTEN 1981/httpd2
tcp 0 0 :::22 :::* LISTEN 1738/sshd
tcp 0 0 :::443 :::* LISTEN 1981/httpd2
udp 0 0 0.0.0.0:111 0.0.0.0:* 1502/portmap
udp 0 0 192.168.1.2:123 0.0.0.0:* 1719/ntpd
udp 0 0 127.0.0.1:123 0.0.0.0:* 1719/ntpd
udp 0 0 0.0.0.0:123 0.0.0.0:* 1719/ntpd
udp 0 0 :::123 :::* 1719/ntpd
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 6455 2284/kdeinit: ksmse /tmp/.ICE-unix/2284
unix 2 [ ACC ] STREAM LISTENING 6326 2259/kdeinit: klaun /tmp/ksocket-lchras/klauncherUxX0za.slave-socket
unix 2 [ ACC ] STREAM LISTENING 6363 2263/fam /tmp/.fam_socket
unix 2 [ ACC ] STREAM LISTENING 6319 2258/gconfd-2 /home/lchras/tmp/orbit-lchras/linc-8d2-0-36bfdee556864
unix 2 [ ACC ] STREAM LISTENING 6289 2255/kdeinit: dcops /tmp/.ICE-unix/dcop2255-1091725718
unix 2 [ ACC ] STREAM LISTENING 6331 2236/magicdev /home/lchras/tmp/orbit-lchras/linc-8bc-0-4d7176f4f2c4
unix 2 [ ACC ] STREAM LISTENING 5331 1631/xfs /tmp/.font-unix/fs-1
unix 2 [ ACC ] STREAM LISTENING 5438 1698/X /tmp/.X11-unix/X0
unix 2 [ ACC ] STREAM LISTENING 6281 2252/kdeinit: Runni /tmp/ksocket-lchras/kdeinit__0
unix 2 [ ACC ] STREAM LISTENING 6283 2252/kdeinit: Runni /tmp/ksocket-lchras/kdeinit-:0
[root@78-XX033 mysql]#
 
Old 08-05-2004, 03:01 PM   #8
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Here's something interesting:

[root@78-XX033 mysql]# ./mysql.server stop
Stopping MySQL Server [FAILED]
[root@78-XX033 mysql]# ./mysql.server start
Starting MySQL Server [ OK ]
[root@78-XX033 mysql]# ./mysql.server stop
Stopping MySQL Server [FAILED]
[root@78-XX033 mysql]# ./mysql.server start
Starting MySQL Server [ OK ]
[root@78-XX033 mysql]# ./mysql.server start
Starting MySQL Server [ OK ]
[root@78-XX033 mysql]# ./mysql.server stop
Stopping MySQL Server [FAILED]


.... what the..... ?
 
Old 08-05-2004, 03:04 PM   #9
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I think it is becauses you started the service twice:

[root@78-XX033 mysql]# ./mysql.server start
Starting MySQL Server [ OK ]
[root@78-XX033 mysql]# mysqld_safe --user=mysql
Starting mysqld daemon with databases from /var/lib/mysql


Try killing all mysqld processes then just starting with "./mysql.server start"
 
Old 08-05-2004, 03:30 PM   #10
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
OK so I did that, the only thing is that with the mysql.server start command, you can't specify a user. Anyway, it made about a billion processes (as does the mysqld_safe command) but the problem still exist.

[snip]
30864 pts1 00:00:00 mysqld
30991 pts1 00:00:00 mysqld
31121 pts1 00:00:00 mysqld
31254 pts1 00:00:00 mysqld
31390 pts1 00:00:00 mysqld
31529 pts1 00:00:00 mysqld
31672 pts1 00:00:00 mysqld
31817 pts1 00:00:00 mysqld
31965 pts1 00:00:00 mysqld
[root@78-XX033 mysql]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@78-XX033 mysql]#
 
Old 08-05-2004, 03:36 PM   #11
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
This seems very odd. What user is mysqld running as:
ps -ef | grep mysql

Is /etc/my.cnf the first file show when you run:
mysqld --help | grep cnf
 
Old 08-05-2004, 03:48 PM   #12
flamesrock
Member
 
Registered: Aug 2003
Distribution: Gentoo 2006.1
Posts: 405

Rep: Reputation: 30
oh god I hate that error.....it seems to be very common.
 
Old 08-06-2004, 10:21 AM   #13
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Flamesrock > yes a common error but unfortunately without a common solution

Hi david_ross, thank you for responding. Here's what I did this morning.

[root@78-XX033 mysql]# ps -a | grep mysql
[root@78-XX033 mysql]# mysqld_safe --user=mysql
Starting mysqld daemon with databases from /var/lib/mysql
[root@78-XX033 mysql]# ps -ef | grep mysql
root 22048 22004 0 11:12 pts0 00:00:00 /bin/sh /usr/bin/mysqld_safe --user=mysql
root 22071 22048 0 11:12 pts0 00:00:00 /bin/sh /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/78-XX033.lchras.workstart-lchras.ca.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock
root 22111 22071 0 11:12 pts0 00:00:00 /bin/sh /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/78-XX033.lchras.workstart-lchras.ca.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock --skip-locking
root 22154 22111 0 11:12 pts0 00:00:00 /bin/sh /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/78-XX033.lchras.workstart-lchras.ca.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock --skip-locking --skip-locking
root 22200 22154 0 11:12 pts0 00:00:00 /bin/sh /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/78-XX033.lchras.workstart-lchras.ca.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock --skip-locking --skip-locking --skip-locking
[snip .. its repeated like a billion times]
root 3010 2727 0 11:16 pts0 00:00:00 /bin/sh /usr/sbin/mysqld --basedir=/ --datadir=/var/lib/mysql --user=mysql --pid-file=/var/lib/mysql/78-XX033.lchras.workstart-lchras.ca.pid --skip-locking --port=3306 --socket=/var/lib/mysql/mysql.sock --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking --skip-locking
root 3096 1169 0 11:17 pts1 00:00:00 grep mysql
[root@78-XX033 mysql]#
 
Old 08-06-2004, 01:11 PM   #14
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
What are the permissions? Can you post the output from:
ls -la /var/lib/mysql
 
Old 08-06-2004, 03:06 PM   #15
Avatar
Member
 
Registered: May 2001
Location: Canada
Distribution: old ones
Posts: 555

Original Poster
Rep: Reputation: 33
Hi david_ross, it's at the end of post # 5 (the very long post). This problem has me totally stumped. Is it possible that somehow the process is starting as root user and root isn't able to create the sock file?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 07:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 01:52 AM
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
can't connect to mysql through socket '/tmp/mysql.sock' Boby Programming 2 05-23-2004 01:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:04 PM.

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