Bug #71192 | Please report socket connections properly and not as localhost | ||
---|---|---|---|
Submitted: | 20 Dec 2013 15:45 | Modified: | 23 Dec 2013 15:23 |
Reporter: | Simon Mudd (OCA) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Information schema | Severity: | S3 (Non-critical) |
Version: | all versions to 5.7.3 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[20 Dec 2013 15:45]
Simon Mudd
[20 Dec 2013 19:37]
Sveta Smirnova
Thank you for the feature request.
[21 Dec 2013 15:50]
Peter Laursen
How should that be possible? To my best knowledge most *nix systems will silently translate 'localhost' (but not 127.0.0.1) to the socket for the service and MySQL (nad other daemons) will even not know that 'localhost' was used/specified by the client. This is an issue with Linux/Unix and not an issue with MySQL as far as I can understand. a Unix SOCKET is a bad joke in today's networked world IMO (.. and I don't expect SM to agree!).
[23 Dec 2013 6:52]
Simon Mudd
One reason for using unix sockets: security. If you only allow access to unix sockets the connection MUST be local and not from the network. So I tend to configure the "root" account to only work from there, thus preventing access from outside. Yes, ::1 or 127.0.0.1 have the same behaviour and right now from a performance point of view I am not sure if there is a difference in performance. This may depend on the platform concerned. In any case the reason for the request is that you can not identify currently from any of the internal MySQL tables the exact origin of the connection if it says localhost. I've been confused by that in the past and speaking to others this does crop up from time to time. This ticket was inspired by a conversation with someone where I was not able to immediately identify the source of a connection so I had to check on the client to be sure how it was connecting to the server. That should not be necessary. Note: Althought the Category has been assigned Server: I_S there are also P_S tables which include hostnames which are equally affected.
[23 Dec 2013 15:23]
Simon Mudd
IPv6 connections to ::1 seem to behave the same though this may be the resolver. myhost:~ root# mysql --host=::1 --user=root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.6.14-log MySQL Community Server (GPL) ... mysql> show processlist; +----+------+-----------------+------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------------+------+---------+------+-------+------------------+ | 5 | root | localhost:62375 | NULL | Query | 0 | init | show processlist | +----+------+-----------------+------+---------+------+-------+------------------+ 1 row in set (0.00 sec) mysql> exit
[24 Dec 2013 21:55]
MySQL Verification Team
see this also: http://dev.mysql.com/doc/refman/5.6/en/socket-instances-table.html