Skip to content

Commit

Permalink
Update to MySQL 9.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
bgrainger committed Jul 3, 2024
1 parent 665792b commit 32cf84c
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="MySql.Data" Version="8.4.0" />
<PackageVersion Include="MySql.Data" Version="9.0.0" />
<PackageVersion Include="NLog" Version="4.5.0" />
<PackageVersion Include="Serilog" Version="2.6.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.556" />
Expand Down
8 changes: 4 additions & 4 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,6 @@ jobs:
vmimage: 'ubuntu-20.04'
strategy:
matrix:
'MySQL 5.7':
image: 'mysql:5.7'
connectionStringExtra: 'Tls Cipher Suites=TLS_RSA_WITH_AES_128_CBC_SHA256,TLS_DHE_RSA_WITH_AES_128_CBC_SHA256'
unsupportedFeatures: 'CachingSha2Password,Ed25519,QueryAttributes,Tls11,Tls13,UuidToBin'
'MySQL 8.0':
image: 'mysql:8.0'
connectionStringExtra: 'AllowPublicKeyRetrieval=True'
Expand All @@ -237,6 +233,10 @@ jobs:
image: 'mysql:8.4'
connectionStringExtra: 'AllowPublicKeyRetrieval=True'
unsupportedFeatures: 'Ed25519,StreamingResults,Tls11,ZeroDateTime'
'MySQL 9.0':
image: 'mysql:9.0'
connectionStringExtra: 'AllowPublicKeyRetrieval=True'
unsupportedFeatures: 'Ed25519,StreamingResults,Tls11,ZeroDateTime'
'MariaDB 10.6':
image: 'mariadb:10.6'
connectionStringExtra: ''
Expand Down
2 changes: 1 addition & 1 deletion docs/content/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Amazon Aurora RDS | 2.x, 3.x | Use `Pipelining=False` [for Aurora 2.x](https://m
Azure Database for MySQL | 5.7, 8.0 | Single Server and Flexible Server
Google Cloud SQL for MySQL | 5.6, 5.7, 8.0 |
MariaDB | 10.x (**10.6**, **10.11**), 11.x (**11.2**) |
MySQL | 5.5, 5.6, **5.7**, 8.x (**8.0**, **8.3**) | 5.5 is EOL and has some [compatibility issues](https://github.com/mysql-net/MySqlConnector/issues/1192); 5.6 and 5.7 are EOL
MySQL | 5.5, 5.6, 5.7, 8.x (**8.0**, **8.4**), **9.0** | 5.5 is EOL and has some [compatibility issues](https://github.com/mysql-net/MySqlConnector/issues/1192); 5.6 and 5.7 are EOL
Percona Server | 5.6, 5.7, 8.0 |
PlanetScale | | See PlanetScale [MySQL compatibility notes](https://planetscale.com/docs/reference/mysql-compatibility)
ProxySQL | 2.x | Some [compatibility issues](https://github.com/search?q=repo%3Amysql-net%2FMySqlConnector+proxysql&type=issues)
Expand Down
2 changes: 1 addition & 1 deletion docs/content/tutorials/migrating-from-connector-net.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ In a .NET Framework application, make the following `app.config` change to regis
<!-- add name="MySQL Data Provider"
invariant="MySql.Data.MySqlClient"
description=".Net Framework Data Provider for MySQL"
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.4.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" / -->
type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=9.0.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" / -->

<!-- ADD THIS -->
<add name="MySqlConnector"
Expand Down
2 changes: 1 addition & 1 deletion tests/IntegrationTests/CharacterSetTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void CollationConnection(bool reopenConnection)
}

var collation = connection.Query<string>(@"select @@collation_connection;").Single();
var expected = connection.ServerVersion.StartsWith("8.", StringComparison.Ordinal) ? "utf8mb4_0900_ai_ci" : "utf8mb4_general_ci";
var expected = connection.ServerVersion.Substring(0, 2) is "8." or "9." ? "utf8mb4_0900_ai_ci" : "utf8mb4_general_ci";
Assert.Equal(expected, collation);
}

Expand Down
3 changes: 2 additions & 1 deletion tests/IntegrationTests/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<system.data>
<DbProviderFactories>
<add name="MySqlConnector" invariant="MySqlConnector" description="Async MySQL ADO.NET Connector" type="MySqlConnector.MySqlConnectorFactory, MySqlConnector, Culture=neutral, PublicKeyToken=d33d3e53aa5f8c92" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.4.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<remove invariant="MySql.Data.MySqlClient" />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=9.0.0.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>
4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ It also verifies that MySqlConnector and MySQL Connector/NET (MySql.Data) have s

The tests require a MySQL server. The simplest way to run one is with [Docker](https://www.docker.com/community-edition):

docker run -d --rm --name mysqlconnector -e MYSQL_ROOT_PASSWORD=pass -p 3306:3306 --tmpfs /var/lib/mysql mysql:8.4 --max-allowed-packet=96M --character-set-server=utf8mb4 --disable-log-bin --local-infile=1 --max-connections=250
docker exec mysqlconnector mysql -uroot -ppass -e "INSTALL COMPONENT 'file://component_query_attributes';"
docker run -d --rm --name mysqlconnector -e MYSQL_ROOT_PASSWORD=pass -p 3306:3306 --tmpfs /var/lib/mysql mysql:9.0 --max-allowed-packet=96M --character-set-server=utf8mb4 --disable-log-bin --local-infile=1 --max-connections=250
docker exec mysqlconnector mysql -uroot -ppass -e "INSTALL COMPONENT 'file://component_query_attributes'; CREATE USER 'caching-sha2-user'@'%' IDENTIFIED WITH caching_sha2_password BY 'Cach!ng-Sh@2-Pa55'; GRANT ALL PRIVILEGES ON *.* TO 'caching-sha2-user'@'%';"

Copy the file `IntegrationTests/config.json.example` to `IntegrationTests/config.json`, then edit
the `config.json` file in order to connect to your server. If you are using the Docker
Expand Down

0 comments on commit 32cf84c

Please sign in to comment.