Back to Flyway

Aurora MySQL

documentation/Reference/Database Driver Reference/Aurora MySQL.md

latest4.9 KB
Original Source
  • Verified Versions: 5.5, 8.0
  • Maintainer: {% include redgate-badge.html %}

Supported Versions and Support Levels

{% include database-boilerplate.html %}

Drivers

ItemDetails
URL format<code>jdbc:mysql://<i>instance</i>.<i>region</i>.rds.amazonaws.com:<i>port</i>/<i>database?usePipelineAuth=false&useBatchMultiSend=false</i></code>
aws-advanced-jdbc-wrapper:
<code>jdbc:aws-wrapper:mysql://<i>instance</i>.<i>region</i>.rds.amazonaws.com:<i>port</i>/<i>database?usePipelineAuth=false&useBatchMultiSend=false</i></code>
SSL supportYes - add ?useSsl=true
Ships with Flyway Command-lineNo
Maven Central coordinatesmysql:mysql-connector-java
Supported versions8.0.12 and later
Default Java classcom.mysql.jdbc.Driver
aws-advanced-jdbc-wrapper:
software.amazon.jdbc.Driver

Note the additional parameters in the connection string, see About MariaDB ConnectorJ for details on Aurora compatibility. aws-advanced-wrapper support is a community addition and not maintained by Redgate

SQL Script Syntax

  • Standard SQL syntax with statement delimiter ;
  • Delimiter change for stored procedures using DELIMITER statements
  • Comment directives generated by mysqldump (/!.../;)
  • MySQL-style single-line comments (# Comment)

Compatibility

  • DDL exported by mysqldump can be used unchanged in a Flyway migration.
  • Any MySQL SQL script executed by Flyway, can be executed by the MySQL command-line tool and other MySQL-compatible tools (after the placeholders have been replaced).

Example

<pre class="prettyprint">/* Single line comment */ CREATE TABLE test_data ( value VARCHAR(25) NOT NULL, PRIMARY KEY(value) ); /* Multi-line comment */ -- MySQL procedure DELIMITER // CREATE PROCEDURE AddData() BEGIN # MySQL-style single line comment INSERT INTO test_data (value) VALUES ('Hello'); END // DELIMITER; CALL AddData(); -- MySQL comments directives generated by mysqlsump /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; -- Placeholder INSERT INTO ${tableName} (name) VALUES ('Mr. T');</pre>

Limitations

  • Issue 558 The parser currently doesn't support multiple comment directives on a single line.

      Example: /*!50003 CREATE*/ /*!50017 DEFINER=`...`*/ /*!50003 TRIGGER EntityBeforeInsert ...