title: Connecting to MySQL Database (hosted in Heroku) from Excel VBA
body: <p>I'm hosting the MySQL database in Heroku. I created a connection from Excel with 'MySQL for Excel' add-in, but I want to establish a connection from Excel with VBA code.</p>
  <p>I get</p>
  <blockquote>
  <p>Access denied for user 'user' to database 'database'</p>
  </blockquote>
  <p>My VBA code, but I think the reason for the error is somewhere else (privileges, database settings, etc... ).</p>
  <pre><code>Dim con As ADODB.Connection
  Set con = New ADODB.Connection
  
  Dim strConn As String
  
  strConn = &quot;Driver={MySQL ODBC 8.0 Unicode Driver};SERVER=serverName;DATABASE=databaseName;USER=username;PASSWORD=password&quot;
  
  con.Open strConn 
  </code></pre>