title: How to connect to MySQL databas using GitHub Actions?
body: <p>In my GitHub Action, I am using a Linux runner (Ubuntu 18.04 and 20.04) and I want to use a MySQL database. So in order to set things up, I run a script like</p>
  <pre><code>sudo apt update
  sudo apt install mysql-server
  
  sudo mysql &lt; someInstructions.txt
  </code></pre>
  <p>However, when I run this script on GitHub Actions, I get the following error:</p>
  <pre><code>ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
  </code></pre>
  <p>So I figured that the MySQL server is not running after it has been installed (which I verified). This is strange, since the docs of the Ubuntu package explicitly states that the server should be running after a successful installation.</p>
  <p>In any case, I then used <code>sudo systemctl start mysql.service</code> to start the MySQL server but now I get this error</p>
  <pre><code>'Access denied for user 'root'@'localhost' (using password: NO)'
  </code></pre>
  <p>This really baffles me as <code>sudo mysql</code> is supposed to connect to the DB as root. I verified that this works on a regular Ubuntu installation.</p>
  <p>Does anyone know how I can connect to a MySQL DB on GitHub Actions?</p>