Pryaxis / TShock

☕️⚡️TShock provides Terraria servers with server-side characters, anti-cheat, and community management tools.
GNU General Public License v3.0
2.41k stars 377 forks source link

Can't Connect to MySQL Server #2442

Closed tsuki-terraria closed 3 years ago

tsuki-terraria commented 3 years ago

Error from Log

2021-08-29 20:16:12 - TShock: INFO: TShock was improperly shut down. Please use the exit command in the future to prevent this.
2021-08-29 20:16:13 - TShock: ERROR: Fatal Startup Exception
2021-08-29 20:16:14 - TShock: ERROR: System.Exception: Fatal TShock initialization exception: failed to connect to MySQL database. See inner exception for details. ---> System.Security.Authentication.AuthenticationException: A call to SSPI failed, see inner exception. ---> System.ComponentModel.Win32Exception: The function requested is not supported
   --- End of inner exception stack trace ---
   at System.Net.Security.SslState.StartSendAuthResetSignal(ProtocolToken message, AsyncProtocolRequest asyncRequest, Exception exception)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessReceivedBlob(Byte[] buffer, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReadFrame(Byte[] buffer, Int32 readBytes, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.StartSendBlob(Byte[] incoming, Int32 count, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest)
   at System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult)
   at System.Net.Security.SslStream.AuthenticateAsClient(String targetHost, X509CertificateCollection clientCertificates, SslProtocols enabledSslProtocols, Boolean checkCertificateRevocation)
   at MySql.Data.MySqlClient.NativeDriver.StartSSL()
   at MySql.Data.MySqlClient.NativeDriver.Open()
   at MySql.Data.MySqlClient.Driver.Open()
   at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
   at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
   at MySql.Data.MySqlClient.MySqlPool.GetConnection()
   at MySql.Data.MySqlClient.MySqlConnection.Open()
   at TShockAPI.DB.DbExt.QueryReader(IDbConnection olddb, String query, Object[] args)
   --- End of inner exception stack trace ---
   at TShockAPI.DB.DbExt.QueryReader(IDbConnection olddb, String query, Object[] args)
   at TShockAPI.DB.SqlTableCreator.GetColumns(SqlTable table)
   at TShockAPI.DB.SqlTableCreator.EnsureTableStructure(SqlTable table)
   at TShockAPI.DB.BanManager..ctor(IDbConnection db)
   at TShockAPI.TShock.Initialize()

I have two server, Database Server and Client Server. I want to connect TShock Client to MySQL but it ended with an error.

Database Server Details: OS Version: Ubuntu 20.04 LTS MySQL Version: mysql Ver 8.0.26 for Linux on x86_64 (MySQL Community Server - GPL)

TShock Server Details: OS Version: Windows Server 2012 R2 TShock Version: TShock 4.5.5 for Terraria 1.4.2.3

Arthri commented 3 years ago

tl;dr: Downgrade your MySQL server to 5.5-5.7 or upgrade the MySql.Data provided with TShock

The version of MySql.Data that TShock uses(6.9.8) only supports MySQL server versions 5.5, 5.6, and 5.7 Source: https://dev.mysql.com/doc/connector-net/en/connector-net-versions.html

You can either downgrade your server version to 5.5, 5.6, or to 5.7; or upgrade the MySql.Data provided with TShock

There are two places you can get the file: https://www.nuget.org/packages/MySql.Data/ https://downloads.mysql.com/archives/c-net/

641i130 commented 3 years ago

I believe this is a duplicate of #2201

tsuki-terraria commented 3 years ago

Thank you @Arthri for your response, i will try to downgrade MySQL version to 5.x i will close this issue.