Isaac Bennetch píše v St 01. 02. 2017 v 17:10 -0500:
When a user does not define `$cfg['Servers'][$i]['host']` but does set `$cfg['Servers'][$i]['connect_type'] = 'tcp';`, the default host of 'localhost' is used, forcing the connection over socket because of how MySQL interprets the host.
Would it be helpful to detect when the user specifies 'tcp' and use a default host of '127.0.0.1' instead of 'localhost', or is that getting to be too much guessing about what the user wants?
I'm not really sure, but this would probably get tricky - what to do if user does set host to localhost and connect_type to tcp?
Looking at our code, the connect_type is really not used much:
- if it is set to tcp, the socket is set to empty, what is not necessary according to http://php.net/mysqli_connect
- if it set to tcp and host is empty error is raised, I'm not sure if special case here is needed, MySQL will fail as well
- sets server verbose name for socket connection, see https://github.co m/phpmyadmin/phpmyadmin/issues/6878
Overall I don't think this parameter actually makes sense - so how about removing it completely?
See https://github.com/phpmyadmin/phpmyadmin/pull/12950