Exception creating ...
 
Notifications
Clear all

Exception creating MySQL Database

4 Posts
1 Users
0 Reactions
1,711 Views
Posts: 15
Topic starter
(@wizzardmr42)
Eminent Member
Joined: 8 years ago

Hi,

 

I've got MySQL 8.0 set up in SolidCP.  When I try to create a database under an account, it tells me that an exception has occurred.  I've checked the SolidCP event log, and it is showing this: -

 

[9/18/2023 9:05:09 PM] ERROR: 'MySQL Server 8.0' DatabaseExists
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at MySql.Data.MySqlClient.MySqlField.SetFieldEncoding()
at MySql.Data.MySqlClient.NativeDriver.GetColumnData(MySqlField field)
at MySql.Data.MySqlClient.NativeDriver.GetColumnsData(MySqlField[] columns)
at MySql.Data.MySqlClient.Driver.GetColumns(Int32 count)
at MySql.Data.MySqlClient.ResultSet.LoadColumns(Int32 numCols)
at MySql.Data.MySqlClient.ResultSet..ctor(Driver d, Int32 statementId, Int32 numCols)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlDataReader.Close()
at MySql.Data.MySqlClient.MySqlCommand.ResetReader()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at SolidCP.Providers.Database.MySqlServer.ExecuteQueryDataSet(String commandText, String connectionString)
at SolidCP.Providers.Database.MySqlServer.ExecuteQuery(String commandText)
at SolidCP.Providers.Database.MySqlServer.DatabaseExists(String databaseName)
at SolidCP.Server.DatabaseServer.DatabaseExists(String databaseName)

 

If I try to import resources for an existing database or user, I get the following stack traces...

[9/18/2023 8:58:29 PM] ERROR: 'MySQL Server 8.0' GetUsers
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at MySql.Data.MySqlClient.MySqlField.SetFieldEncoding()
at MySql.Data.MySqlClient.NativeDriver.GetColumnData(MySqlField field)
at MySql.Data.MySqlClient.NativeDriver.GetColumnsData(MySqlField[] columns)
at MySql.Data.MySqlClient.Driver.GetColumns(Int32 count)
at MySql.Data.MySqlClient.ResultSet.LoadColumns(Int32 numCols)
at MySql.Data.MySqlClient.ResultSet..ctor(Driver d, Int32 statementId, Int32 numCols)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlDataReader.Close()
at MySql.Data.MySqlClient.MySqlCommand.ResetReader()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at SolidCP.Providers.Database.MySqlServer.ExecuteQueryDataSet(String commandText, String connectionString)
at SolidCP.Providers.Database.MySqlServer.ExecuteQuery(String commandText)
at SolidCP.Providers.Database.MySqlServer.GetUsers()
at SolidCP.Server.DatabaseServer.GetUsers()

 

[9/18/2023 8:58:28 PM] ERROR: 'MySQL Server 8.0' GetDatabases
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at MySql.Data.MySqlClient.MySqlField.SetFieldEncoding()
at MySql.Data.MySqlClient.NativeDriver.GetColumnData(MySqlField field)
at MySql.Data.MySqlClient.NativeDriver.GetColumnsData(MySqlField[] columns)
at MySql.Data.MySqlClient.Driver.GetColumns(Int32 count)
at MySql.Data.MySqlClient.ResultSet.LoadColumns(Int32 numCols)
at MySql.Data.MySqlClient.ResultSet..ctor(Driver d, Int32 statementId, Int32 numCols)
at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
at MySql.Data.MySqlClient.MySqlDataReader.Close()
at MySql.Data.MySqlClient.MySqlCommand.ResetReader()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
at SolidCP.Providers.Database.MySqlServer.ExecuteQueryDataSet(String commandText, String connectionString)
at SolidCP.Providers.Database.MySqlServer.ExecuteQuery(String commandText)
at SolidCP.Providers.Database.MySqlServer.GetDatabases()
at SolidCP.Server.DatabaseServer.GetDatabases()

 

Any ideas?

3 Replies
Posts: 15
Topic starter
(@wizzardmr42)
Eminent Member
Joined: 8 years ago

Installing Connector/NET 8.0.33 seems to have got rid of this problem, but now I'm getting a StackOverflowException where SolidCP.Providers.Database.MySQL.dll!SolidCP.Providers.Database.MySqlServer.CurrentDomain_AssemblyResolve(object sender, System.ResolveEventArgs args) is calling Assembly.Resolve, which loops back round over and over - I think it is because of the answer on this post, but not sure if that is the case and if so how to work out what the dependencies are https://stackoverflow.com/questions/32245273/assembly-resolve-recurses-into-an-infinite-loop

Reply
Posts: 15
Topic starter
(@wizzardmr42)
Eminent Member
Joined: 8 years ago

Worked out from fuslogvw that it couldn't find MySQL.Data.dll, so I added that to the bin folder of SolidCP Server and now I get

Service installation results: Could not connect to the specified MySQL Server: Authentication method 'caching_sha2_password' not supported by any of the available plugins.

Finding this a lot of hassle!

Reply
Posts: 15
Topic starter
(@wizzardmr42)
Eminent Member
Joined: 8 years ago

Finally worked it out - I used gacutil /i and added a bindingRedirect to SolidCP Server's web.config to point to the new version of MySQL.Data to install MySQL.Data.dll to the GAC  -

...
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="bin/Crm2011;bin/Crm2013;bin/Exchange2013;bin/Exchange2016;bin/Exchange2019;bin/Sharepoint2013;bin/Sharepoint2016;bin/Sharepoint2019;bin/Lync2013;bin/SfB2015;bin/SfB2019;bin/Lync2013HP;bin/Dns2012;bin/IceWarp;bin/IIs80;bin/IIs100;bin/HyperV2012R2;bin/HyperVvmm;bin/Crm2015;bin/Crm2016;bin/Filters" />
 
<dependentAssembly>
<assemblyIdentity name="MySQL.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-8.1.0.0" newVersion="8.1.0.0" />
</dependentAssembly>
    </assemblyBinding>
  </runtime>
...
Reply
Share: