title: WSL: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
body: <p>I'm trying to use a fresh installation of MySQL on Windows Subsystem for Linux (Ubuntu) and can't seem to ever connect to it. I always get the error:
  <code>WSL: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)</code></p>
  <p>I've tried:</p>
  <ul>
  <li>Switching the configuration to use localhost instead of sockets (I instead get an error saying I can't connect through localhost)</li>
  <li>Using <code>--skip-grant-tables</code> by editing <code>/etc/mysql/mysql.conf.d/mysqld.cnf</code> and restarting</li>
  </ul>
  <p>The file <code>/var/run/mysqld/mysqld.sock</code> never shows up either, though I figure this is because WSL doesn't have perfect socket support to begin with but it should still work. I suspect the problem might be specific to WSL and maybe I should try updating to WSL2? I don't know what else the issue could be.</p>