MySQL Connection Layer
The connection layer maintains one thread per connection. This thread handles query execution. Before a connection can begin sending SQL queries, the connection is authenticated by verification of username, password, and client host.
The connection layer accepts connections from applications over several communication
protocols:
• TCP/IP
• UNIX sockets
• Shared memory
• Named pipes
Local and Remote Communications Protocol: TCP/IP
The suite of communication protocols used to connect hosts on the Internet
– Uses IP addresses or DNS host names to identify hosts
– Uses TCP port numbers to identify specific services on each
host
– MySQL default TCP port number: 3306
Example using hostname
mysql --host=mysqlhost1 -uroot -p
Example using IP address
mysql -h 192.168.1.8 -P 3309 -uroot -p
Local Communication Protocol in Linux: Socket
Example using socket file /var/lib/mysql/.socket
mysql -S /var/lib/mysql/.socket -uroot -p
Example using default socket file /tmp/mysql.sock
mysql -uroot -p