Spinning the Wheel of Protocols

Wheel of protocol, turn turn turn.
Tell us the lesson that we should learn.
(with apologies to the original source)

Writing a book comes with many challenges. For me, writing a MySQL book for MySQL beginners, who may or may not be database beginners, has fed my compulsion to research and test bizarre interactions.

Today’s lesson is on what protocol is used when connecting to a local mysqld instance on a non-Windows machine. The TCP/IP protocol is used by default when connecting on a Windows machine, and connecting from any operating system to a non-local mysqld instance. I am assuming the connections are being made by a command line client such as mysql, mysqladmin or mysqldump. Connections made via connectors such as Connector/J, an ODBC connector, DBD::mysql, etc are not covered in this post.

If you seem to be having trouble connecting, check your options against your intentions. Unexpected behavior is usually seen when your intention is to connect using TCP/IP, but the connection is using a socket file instead. Note the following behaviors:

(more…)

Wheel of protocol, turn turn turn.
Tell us the lesson that we should learn.
(with apologies to the original source)

Writing a book comes with many challenges. For me, writing a MySQL book for MySQL beginners, who may or may not be database beginners, has fed my compulsion to research and test bizarre interactions.

Today’s lesson is on what protocol is used when connecting to a local mysqld instance on a non-Windows machine. The TCP/IP protocol is used by default when connecting on a Windows machine, and connecting from any operating system to a non-local mysqld instance. I am assuming the connections are being made by a command line client such as mysql, mysqladmin or mysqldump. Connections made via connectors such as Connector/J, an ODBC connector, DBD::mysql, etc are not covered in this post.

If you seem to be having trouble connecting, check your options against your intentions. Unexpected behavior is usually seen when your intention is to connect using TCP/IP, but the connection is using a socket file instead. Note the following behaviors:

(more…)