Pryaxis / TShock

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

Fail to connect to mysql DB but DB exist and wotks fine #3043

Open jpVm5jYYRE1VIKL opened 1 month ago

jpVm5jYYRE1VIKL commented 1 month ago
<!-- Please provide the information requested below -->

TerrariaAPI Version: 2.1.0.0 (Protocol v1.4.4.9 (279), OTAPI 1.4.4.9)

[TShock] Info Config path has been set to /terraria/config

[TShock] Info Log path has been set to /terraria/logs

TShock was improperly shut down. Please use the exit command in the future to prevent this.

TShock encountered a problem from which it cannot recover. The following message may help diagnose the problem.

Until the problem is resolved, TShock will not be able to start (and will crash on startup).

System.Exception: Fatal TShock initialization exception: failed to connect to MySQL database. See inner exception for details.

 ---> System.InvalidCastException: Object cannot be cast from DBNull to other types.

   at System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider)

   at MySql.Data.MySqlClient.Driver.LoadCharacterSets(MySqlConnection connection)

   at MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection)

   at MySql.Data.MySqlClient.MySqlConnection.Open()

   at TShockAPI.DB.DbExt.QueryReader(IDbConnection olddb, String query, Object[] args) in /home/runner/work/TShock/TShock/TShockAPI/Extensions/DbExt.cs:line 67

   --- End of inner exception stack trace ---

   at TShockAPI.DB.DbExt.QueryReader(IDbConnection olddb, String query, Object[] args) in /home/runner/work/TShock/TShock/TShockAPI/Extensions/DbExt.cs:line 79

   at TShockAPI.DB.SqlTableCreator.GetColumns(SqlTable table) in /home/runner/work/TShock/TShock/TShockAPI/DB/SqlTable.cs:line 90

   at TShockAPI.DB.SqlTableCreator.EnsureTableStructure(SqlTable table) in /home/runner/work/TShock/TShock/TShockAPI/DB/SqlTable.cs:line 58

   at TShockAPI.DB.BanManager..ctor(IDbConnection db) in /home/runner/work/TShock/TShock/TShockAPI/DB/BanManager.cs:line 77

   at TShockAPI.TShock.Initialize() in /home/runner/work/TShock/TShock/TShockAPI/TShock.cs:line 369

Created new 8401x2401 DefaultCollection`1 for source: System.Void Terraria.Main::.cctor()
sgkoishi commented 1 month ago

MySQL 8.x? Somehow remember reports about broken 8.x

jpVm5jYYRE1VIKL commented 1 month ago

Hi Nope . I using Mariadb . In previous bersions of tshock which is mono based everything worked good. After upgrade to core based not work anymore