what exactly does mysql.sock store?
mysql.sock
is generally used to connect to databases locally as a socket for mysql
, which is faster than TCP/IP
connections. It is usually placed under the / tmp/mysql.sock
directory. Let"s first take a look at its contents:
[root@ tmp]-sharp mysql -uroot -p -hlocalhost
ERROR 2002 (HY000): Can"t connect to local MySQL server through socket "/var/lib/mysql/mysql.sock" (2)
the contents of the two are exactly the same except that the inode
numbers are different, but you can"t use mysql
to access the local database. Why can"t the new socket
replace the original socket
file? what exactly is stored in this file, and how is it authenticated with the database?