mysql
(for good reasons) tries very hard to connect to the socket file when the XAMPP mysql server is at 'localhost'. But since Win64 mysqld
of course does not drop a socket file inside the Windows Subsystem for Linux filesytem, it can't connect through the socket file. How do I force it to use the port?
$ mysql --port=3306 -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directo
ry")
Nmap shows port 3306 is accessible.
$ nmap localhost -p 3306
Starting Nmap 7.60 ( https://nmap.org ) at 2019-04-25 09:58 DST
Problem binding to interface , errno: 92
socket_bindtodevice: Protocol not available
Problem binding to interface , errno: 92
socket_bindtodevice: Protocol not available
Problem binding to interface , errno: 92
socket_bindtodevice: Protocol not available
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0019s latency).
PORT STATE SERVICE
3306/tcp open mysql
Nmap done: 1 IP address (1 host up) scanned in 0.05 seconds
I'd rather not not bind mysqld to my outside network if I don't need to.
How do I tell the mysql software, "Look I know what you think, but please use port 3306, and not the socket"? Preferably I'd like to know how to tell the same to PHP too.