By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,081 Members | 1,348 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,081 IT Pros & Developers. It's quick & easy.

Why using TCP/IP instead of Unix Sockets?

P: n/a
An associate has asked me to take a look a problem he's having with starting
mysql. I thought I'd give it a shot to learn some more about mySQL before
having him turn it over to someone more knowledgeable than I. But I have to
ask here first.

Attempting to connect to the database via mysqladmin or mysql results in the
error (paraphrased) "Cannot connect to local database using socket
"/var/lib/mysql/mysql.sock".

That is the path to the socked specifiet in both mysqld and client sections
of the my.cnf.

mysqladmin -h `hostname` version shows that the Connection is via TCP/IP
rather than Unix Sockets.

Running on Redhat Linux AE 3 (I think)

/var/lib/mysql is world-writable-readable, but it is not owned by user mysql
(my next attempt to fix this)

/var/lib/mysql/mysql.sock is 777.

My question: What would be causing mysqld to be using TCP rather than Unix
sockets? I've checked permissions, verified settings in my.cnf (which is
very sparse... other entries are for logging), confirmed mysqld is running
and accessible via TCP/IP.

I'm fishing for clues. Any help appreciated.

- Virgil
Jul 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a

"Virgil Green" <vj*@obsydian.com> wrote in message
news:4l**************@newssvr23.news.prodigy.com.. .
An associate has asked me to take a look a problem he's having with starting mysql. I thought I'd give it a shot to learn some more about mySQL before
having him turn it over to someone more knowledgeable than I. But I have to ask here first. [snip ] /var/lib/mysql is world-writable-readable, but it is not owned by user mysql (my next attempt to fix this)


Is it possible this directory is not world-executable so that the mysql
account can't get in the directory?

Does the following work?

$ su -
$ su mysql
$ ls -l /var/lib/mysql/

Perhaps the domain sockets hasn't started?

$ netstat -na
.......
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 80825 /tmp/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 3483 /dev/gpmctl

Regards,

Mike Chirico
Jul 20 '05 #2

P: n/a

"Virgil Green" <vj*@obsydian.com> wrote in message
news:4l**************@newssvr23.news.prodigy.com.. .
An associate has asked me to take a look a problem he's having with starting mysql. I thought I'd give it a shot to learn some more about mySQL before
having him turn it over to someone more knowledgeable than I. But I have to ask here first. [snip ] /var/lib/mysql is world-writable-readable, but it is not owned by user mysql (my next attempt to fix this)


Is it possible this directory is not world-executable so that the mysql
account can't get in the directory?

Does the following work?

$ su -
$ su mysql
$ ls -l /var/lib/mysql/

Perhaps the domain sockets hasn't started?

$ netstat -na
.......
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 80825 /tmp/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 3483 /dev/gpmctl

Regards,

Mike Chirico
Jul 20 '05 #3

P: n/a

"Virgil Green" <vj*@obsydian.com> wrote in message
news:4l**************@newssvr23.news.prodigy.com.. .
An associate has asked me to take a look a problem he's having with starting mysql. I thought I'd give it a shot to learn some more about mySQL before
having him turn it over to someone more knowledgeable than I. But I have to ask here first. [snip ] /var/lib/mysql is world-writable-readable, but it is not owned by user mysql (my next attempt to fix this)


Is it possible this directory is not world-executable so that the mysql
account can't get in the directory?

Does the following work?

$ su -
$ su mysql
$ ls -l /var/lib/mysql/

Perhaps the domain sockets hasn't started?

$ netstat -na
.......
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 80825 /tmp/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 3483 /dev/gpmctl

Regards,

Mike Chirico
Jul 20 '05 #4

P: n/a
"Mike Chirico" <mc******@comcast.net> wrote in message
news:vp********************@comcast.com...

"Virgil Green" <vj*@obsydian.com> wrote in message
news:4l**************@newssvr23.news.prodigy.com.. .
An associate has asked me to take a look a problem he's having with starting
mysql. I thought I'd give it a shot to learn some more about mySQL before having him turn it over to someone more knowledgeable than I. But I have

to
ask here first.

[snip ]
/var/lib/mysql is world-writable-readable, but it is not owned by user

mysql
(my next attempt to fix this)


Is it possible this directory is not world-executable so that the mysql
account can't get in the directory?

Does the following work?

$ su -
$ su mysql
$ ls -l /var/lib/mysql/


Yes, this worked. As it happens, I had reported the mysql directory with the
wrong permissions earlier it was actually owned by mysql and world-readable
and executable.
Perhaps the domain sockets hasn't started?

$ netstat -na
......
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 80825 /tmp/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 3483 /dev/gpmctl


This command showed the socket started with the expected path.

*However*...

When I went to test these things this evening, I also discovered that mysqld
was running with sockets rather than TCP/IP and I noted that it had been up
for only just over an hour and a half though I hadn't touched the system in
over 15 hours. So, I'm checking to see if my associate made other changes or
merely restarted the system.

Thanks for your time, Mike, and your suggestions.

- Virgil
Jul 20 '05 #5

P: n/a
"Mike Chirico" <mc******@comcast.net> wrote in message
news:vp********************@comcast.com...

"Virgil Green" <vj*@obsydian.com> wrote in message
news:4l**************@newssvr23.news.prodigy.com.. .
An associate has asked me to take a look a problem he's having with starting
mysql. I thought I'd give it a shot to learn some more about mySQL before having him turn it over to someone more knowledgeable than I. But I have

to
ask here first.

[snip ]
/var/lib/mysql is world-writable-readable, but it is not owned by user

mysql
(my next attempt to fix this)


Is it possible this directory is not world-executable so that the mysql
account can't get in the directory?

Does the following work?

$ su -
$ su mysql
$ ls -l /var/lib/mysql/


Yes, this worked. As it happens, I had reported the mysql directory with the
wrong permissions earlier it was actually owned by mysql and world-readable
and executable.
Perhaps the domain sockets hasn't started?

$ netstat -na
......
udp 0 0 127.0.0.1:123 0.0.0.0:*
udp 0 0 0.0.0.0:123 0.0.0.0:*
Active UNIX domain sockets (servers and established)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 80825 /tmp/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 3483 /dev/gpmctl


This command showed the socket started with the expected path.

*However*...

When I went to test these things this evening, I also discovered that mysqld
was running with sockets rather than TCP/IP and I noted that it had been up
for only just over an hour and a half though I hadn't touched the system in
over 15 hours. So, I'm checking to see if my associate made other changes or
merely restarted the system.

Thanks for your time, Mike, and your suggestions.

- Virgil
Jul 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.