title: Symfony - How to connect to remote mysql database without install mysql-server
body: <p>I am trying to connect to a remote mysql database with my Symfony application. I don't want to install the mysql-server package on my server if I don't need to but when I try to connect, I get the following error:</p>
  
  <pre><code>  [Doctrine\DBAL\Exception\ConnectionException]                                     
    An exception occured in driver: SQLSTATE[HY000] [2002] No such file or directory  
  
  
    [Doctrine\DBAL\Driver\PDOException]               
    SQLSTATE[HY000] [2002] No such file or directory                                                          
  
  
    [PDOException]                                    
    SQLSTATE[HY000] [2002] No such file or directory  
  </code></pre>
  
  <p>Here's what my database configuration look like. In the variables, I setup <code>pdo_mysql</code> as the driver and the other fields are working well.</p>
  
  <pre><code>doctrine:
      dbal:
          default_connection: default
          connections:
              default:
                  driver:   %database.driver%
                  host:     %database.host%
                  port:     %database.port%
                  dbname:   %database.name%
                  user:     %database.user%
                  password: %database.password%
                  charset:  UTF8     
  </code></pre>
  
  <p><strong>Edit1:</strong> If I install mysql-server, it works and the error is gone.<br>
  <strong>Edit2:</strong> My server is running Ubuntu 16.04.2 LTS        </p>