@@ -7,6 +7,7 @@ use Windows named pipes from the Windows Subsystem for Linux (WSL).
7
7
For example, you can:
8
8
9
9
* Connect to Docker for Windows from the Linux Docker client in WSL
10
+ * Connect to MySQL Server running as a Windows service
10
11
* Connect interactively to a Hyper-V Linux VM's serial console
11
12
* Use gdb to connect to debug the kernel of a Hyper-V Linux VM
12
13
@@ -105,6 +106,45 @@ $ sudo adduser <my_user> docker
105
106
106
107
Then open a new WSL window to reset your group membership.
107
108
109
+ ## Connect to MySQL Server running as a Windows service
110
+
111
+ If you run MySQL Server as a Windows service, you can configure it to
112
+ communicate through TCP, named pipes or shared memory. If you use named
113
+ pipes, connecting to MySQL from WSL is very similar to connecting
114
+ to Docker.
115
+
116
+ The ` mysqld-relay ` script is designed to be run in a ` sudo ` shell.
117
+ Before creating the relay, it will try to configure your environment
118
+ (if it has not been configured yet) by:
119
+
120
+ * creating ` /var/run/mysqld/ ` ,
121
+ * creating a ` mysql ` group, and
122
+ * adding your user account to the ` mysql ` group.
123
+
124
+ You can of course pull out just the npiperelay command if you don't
125
+ need any of the above checks.
126
+
127
+ Note that if you need to enter a password for sudo, the following
128
+ command will fail because of the lack of password input:
129
+
130
+ ``` bash
131
+ $ sudo mysqld-relay &
132
+ ```
133
+
134
+ In that case, you can run it like this:
135
+
136
+ ``` bash
137
+ user@machine:~ $ sudo -s
138
+ [sudo] password for user:
139
+ root@machine:~ # mysqld-relay &
140
+ root@machine:~ # exit
141
+ user@machine:~ $ _
142
+ ```
143
+
144
+ Now you can use the Linux ` mysql ` command line client or any other
145
+ Linux process that expects to talk to MySQL Server through
146
+ ` /var/run/mysqld/mysqld.sock ` .
147
+
108
148
## Connecting to a Hyper-V Linux VM's serial console
109
149
110
150
If you have a Linux VM configured in Hyper-V, you may wish to use its serial
0 commit comments