Could not create connection to database server. (MySQL)

Here’s my config from a project where this works for me.
Cargo.run profile:

<profile>
      <id>cargo.run</id>
      <properties>
        <!--Already defined in hippo-cms-project POM. Override here for project, if necessary-->
        <!--<repo.bootstrap>true</repo.bootstrap>-->
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <configuration>
              <configuration>
                <configfiles>
                  <configfile>
                    <file>${project.basedir}/conf/context.xml</file>
                    <todir>conf/</todir>
                    <tofile>context.xml</tofile>
                  </configfile>
                  <configfile>
                    <file>${project.basedir}/conf/catalina-logging.properties</file>
                    <todir>conf/</todir>
                    <tofile>logging.properties</tofile>
                  </configfile>
                </configfiles>
                <files>
                  <file>
                    <file>${project.basedir}/repository-data/development/target/myhippoproject-repository-data-development-${project.version}.jar</file>
                    <todir>${development-module-deploy-dir}</todir>
                  </file>
                </files>
              </configuration>
              <deployables>
                <deployable>
                  <type>war</type>
                  <properties>
                    <context>/cms</context>
                  </properties>
                  <location>${project.basedir}/cms/target/cms.war</location>
                </deployable>
                <deployable>
                  <location>${project.basedir}/site/target/site.war</location>
                  <type>war</type>
                  <properties>
                    <context>/site</context>
                  </properties>
                </deployable>
                <deployable>
                  <location>${project.basedir}/essentials/target/essentials.war</location>
                  <type>war</type>
                  <properties>
                    <context>/essentials</context>
                  </properties>
                </deployable>
              </deployables>
              <container>
                <dependencies>
                  <dependency>
                    <groupId>mysql</groupId>
                    <artifactId>mysql-connector-java</artifactId>
                    <classpath>extra</classpath>
                  </dependency>
                </dependencies>
                <systemProperties>
                  <log4j.configurationFile>file://${project.basedir}/conf/log4j2-dev.xml</log4j.configurationFile>
                  <!-- enables auto export and web files watch: -->
                  <project.basedir>${project.basedir}</project.basedir>
                  <send.usage.statistics.to.hippo>true</send.usage.statistics.to.hippo>
                  <repo.config>file:${project.basedir}/conf/repository.xml</repo.config>
                  <org.apache.jackrabbit.core.cluster.node_id>${cluster.node}</org.apache.jackrabbit.core.cluster.node_id>
                </systemProperties>
              </container>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>

conf/context.xml:
(I created a db called repositoryds)

  <Resource
    name="jdbc/repositoryDS" auth="Container" type="javax.sql.DataSource"
    maxTotal="100" maxIdle="10" initialSize="2" maxWaitMillis="10000"
    testWhileIdle="true" testOnBorrow="false" validationQuery="SELECT 1"
    timeBetweenEvictionRunsMillis="10000"
    minEvictableIdleTimeMillis="60000"
    username="hippo" password="hippo"
    driverClassName="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/repositoryDS?characterEncoding=utf8&amp;useSSL=false"/>-->

Hope this helps