Ghmattimysql: My MySQL Implementation for FiveM [1.3.2]

I have the same problem, all correctly configured but these “errors” appearing, cant even connect to the server.

Do you have an updated location to this referenced file? Or do you have a new document to show how to use your library in C#? Currently scanning over the code to understand it.

I have however got the code to build etc but just issues with dependency.

Edit:
Current Error:
GHMattiMySQL.net: System.IO.FileNotFoundException

is listed as a dependancy; dependency ‘GHMattiMySQL’

On the latest server version I am getting this:

error in mono_error_set_method_load: Could not find method with signature char,StringSplitOptions
 
Exception loading assembly System.Buffers: System.IO.FileNotFoundException: Unable to find the specified file.
 
 
 
 
 
Server stack trace: 
 
  at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR (System.Int32 errorCode) [0x0000a] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at (wrapper cominterop) CitizenFX.Core.IScriptHost:OpenHostFile (string)
 
  at (wrapper cominterop-invoke) CitizenFX.Core.IScriptHost:OpenHostFile (string)
 
  at CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.OpenHostFile (System.String fileName) [0x00000] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\MonoScriptRuntime.cs:288 
 
  at (wrapper remoting-invoke-with-check) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (string)
 
  at (wrapper xdomain-dispatch) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (object,byte[]&,byte[]&,string)
 
 
 
Exception rethrown at [0]: 
 
  at (wrapper xdomain-invoke) CitizenFX.Core.Monoerror in mono_error_set_assembly_load: Could not load file or assembly 'System.Buffers, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
 
ScriptRuntime+WrapScriptHost:OpenHostFile (string)
 
  at CitizenFX.Core.InternalManager.LoadAssembly (System.String name) [0x00000] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\InternalManager.cs:120 
Exception loading assembly System.Buffers: System.IO.FileNotFoundException: Unable to find the specified file.
 
 
 
 
 
Server stack trace: 
 
  at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR (System.Int32 errorCode) [0x0000a] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at (wrapper cominterop) CitizenFX.Core.IScriptHost:OpenHostFile (string)
 
  at (wrapper cominterop-invoke) CitizenFX.Core.IScriptHost:OpenHostFile (string)
 
  at CitizenFX.Core.MonoScriptRuntime+WrapScriptHost.OpenHostFile (System.String fileName) [0x00000] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\MonoScriptRuntime.cs:288 
 
  at (wrapper remoting-invoke-with-check) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (string)
 
  at (wrapper xdomain-dispatch) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (object,byte[]&,byte[]&,string)
 
 
 
Exception rethrown at [0]: 
 
  at (wrapper xdomain-invoke) CitizenFX.Core.MonoScriptRuntime+WrapScriptHost:OpenHostFile (string)
 
  at CitizenFX.Core.InternalManager.LoadAssembly (System.String name) [0x00000] in C:\gl\builds\4ff63adb\0\cfx\fivem\code\client\clrcore\InternalManager.cs:120 
Unhandled exception: MySql.Data.MySqlClient.MySqlException (0x80004005): Couldn't connect to server ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Buffers, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
 
File name: 'System.Buffers, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
 
  at MySqlConnector.Protocol.Serialization.ProtocolUtility.WritePayloadAsync (MySqlConnector.Protocol.Serialization.IByteHandler byteHandler, System.Func`1[TResult] getNextSequenceNumber, System.ArraySegment`1[T] payload, MySqlConnector.Protocol.Serialization.IOBehavior ioBehavior) [0x0001f] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at MySqlConnector.Protocol.Serialization.StandardPayloadHandler.WritePayloadAsync (System.ArraySegment`1[T] payload, MySqlConnector.Protocol.Serialization.IOBehavior ioBehavior) [0x00000] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at MySqlConnector.Core.ServerSession.SendReplyAsync (MySqlConnector.Protocol.PayloadData payload, MySqlConnector.Protocol.Serialization.IOBehavior ioBehavior, System.Threading.CancellationToken cancellationToken) [0x00013] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at MySqlConnector.Core.ServerSession.TryAsyncContinuation (System.Threading.Tasks.Task`1[TResult] task) [0x00020] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2[TAntecedentResult,TResult].InnerInvoke () [0x00024] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.Tasks.Task.Execute () [0x00010] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[TResult].GetResult () [0x0001e] in <4ac30274d31c4b8099694c24336fcb22>:0 
 
  at MySqlConnector.Core.ServerSession+<ConnectAsync>d__56.MoveNext () [0x00611] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at MySqlConnector.Core.ServerSession+<ConnectAsync>d__56.MoveNext () [0x0082e] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at MySqlConnector.Core.ConnectionPool+<GetSessionAsync>d__6.MoveNext () [0x006a9] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[TResult].GetResult () [0x0001e] in <4ac30274d31c4b8099694c24336fcb22>:0 
 
  at MySql.Data.MySqlClient.MySqlConnection+<CreateSessionAsync>d__83.MoveNext () [0x0018e] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[TResult].GetResult () [0x0001e] in <4ac30274d31c4b8099694c24336fcb22>:0 
 
  at MySql.Data.MySqlClient.MySqlConnection+<OpenAsync>d__25.MoveNext () [0x000e3] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00017] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at GHMatti.MySQL.MySQL+<>c__DisplayClass5_0.<QueryResult>b__0 () [0x00033] in <6d9d4fdcb1524b1db0455aee1977961f>:0 
 
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.Tasks.Task.Execute () [0x00010] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at ESMySql.MySqlPlugin+<<Initialization>b__3_1>d.MoveNext () [0x000a2] in <9fef236d4f55422099949c7f4f84b7f1>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_1 (System.Object state) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x00007] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
GlobalError: Unhandled exception in Mono script environment: MySql.Data.MySqlClient.MySqlException (0x80004005): Couldn't connect to server ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Buffers, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies.
 
File name: 'System.Buffers, Version=4.0.1.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
 
  at MySqlConnector.Protocol.Serialization.ProtocolUtility.WritePayloadAsync (MySqlConnector.Protocol.Serialization.IByteHandler byteHandler, System.Func`1[TResult] getNextSequenceNumber, System.ArraySegment`1[T] payload, MySqlConnector.Protocol.Serialization.IOBehavior ioBehavior) [0x0001f] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at MySqlConnector.Protocol.Serialization.StandardPayloadHandler.WritePayloadAsync (System.ArraySegment`1[T] payload, MySqlConnector.Protocol.Serialization.IOBehavior ioBehavior) [0x00000] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at MySqlConnector.Core.ServerSession.SendReplyAsync (MySqlConnector.Protocol.PayloadData payload, MySqlConnector.Protocol.Serialization.IOBehavior ioBehavior, System.Threading.CancellationToken cancellationToken) [0x00013] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at MySqlConnector.Core.ServerSession.TryAsyncContinuation (System.Threading.Tasks.Task`1[TResult] task) [0x00020] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2[TAntecedentResult,TResult].InnerInvoke () [0x00024] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.Tasks.Task.Execute () [0x00010] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[TResult].GetResult () [0x0001e] in <4ac30274d31c4b8099694c24336fcb22>:0 
 
  at MySqlConnector.Core.ServerSession+<ConnectAsync>d__56.MoveNext () [0x00611] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at MySqlConnector.Core.ServerSession+<ConnectAsync>d__56.MoveNext () [0x0082e] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at MySqlConnector.Core.ConnectionPool+<GetSessionAsync>d__6.MoveNext () [0x006a9] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[TResult].GetResult () [0x0001e] in <4ac30274d31c4b8099694c24336fcb22>:0 
 
  at MySql.Data.MySqlClient.MySqlConnection+<CreateSessionAsync>d__83.MoveNext () [0x0018e] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[TResult].GetResult () [0x0001e] in <4ac30274d31c4b8099694c24336fcb22>:0 
 
  at MySql.Data.MySqlClient.MySqlConnection+<OpenAsync>d__25.MoveNext () [0x000e3] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00017] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at GHMatti.MySQL.MySQL+<>c__DisplayClass5_0.<QueryResult>b__0 () [0x00033] in <6d9d4fdcb1524b1db0455aee1977961f>:0 
 
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.Tasks.Task.Execute () [0x00010] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at ESMySql.MySqlPlugin+<<Initialization>b__3_1>d.MoveNext () [0x000a2] in <9fef236d4f55422099949c7f4f84b7f1>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_1 (System.Object state) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x00007] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0    at MySqlConnector.Core.ServerSession+<ConnectAsync>d__56.MoveNext () [0x0082e] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredTaskAwaitable+ConfiguredTaskAwaiter.GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at MySqlConnector.Core.ConnectionPool+<GetSessionAsync>d__6.MoveNext () [0x006a9] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[TResult].GetResult () [0x0001e] in <4ac30274d31c4b8099694c24336fcb22>:0 
 
  at MySql.Data.MySqlClient.MySqlConnection+<CreateSessionAsync>d__83.MoveNext () [0x0018e] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[TResult].GetResult () [0x0001e] in <4ac30274d31c4b8099694c24336fcb22>:0 
 
  at MySql.Data.MySqlClient.MySqlConnection+<OpenAsync>d__25.MoveNext () [0x000e3] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at MySql.Data.MySqlClient.MySqlConnection.Open () [0x00017] in <6c19527d9b9d44f7b66a2f8aa7232d9b>:0 
 
  at GHMatti.MySQL.MySQL+<>c__DisplayClass5_0.<QueryResult>b__0 () [0x00033] in <6d9d4fdcb1524b1db0455aee1977961f>:0 
 
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0000f] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.Tasks.Task.Execute () [0x00010] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) [0x0003e] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) [0x00028] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) [0x00008] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.TaskAwaiter`1[TResult].GetResult () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at ESMySql.MySqlPlugin+<<Initialization>b__3_1>d.MoveNext () [0x000a2] in <9fef236d4f55422099949c7f4f84b7f1>:0 
 
--- End of stack trace from previous location where exception was thrown ---
 
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000c] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__6_1 (System.Object state) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x00007] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 
 
  at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <0123fd5b1a1040fe9d70a7e0d4b28acb>:0 ```

Did you make sure the System.Buffers.dll is in the folder?

I did indeed.

Thats annoying, see I was going to ask you how you got this far as I’m having a library of issues as this is not well documented for C#, I’ve got it as far as having version issues with my instancing.

So, from what I have found…the dlls all have to have *.net.dll (FiveM requirement) and referenced the same inside the project… This works and now I have NullRef exceptions when executing QueryResult… least I’m getting somewhere.

Edit: 2 hours later… I can get it running but cannot get it to stop hanging on a result return. Never used Tasks before so I’m trying my best to understand them.

I am trying to get this to work to us the CopsFM mod and I am lost. Only error I have.

@kack8457 Don’t use MySQL 8.x, it defaults to an auth mode that is not implemented. Either up or downgrade your mysql server.

I’m using MySQL 8.x with the old style auth and it connects fine. Only issue is awaiting the task to run (I’m coding in C#) but I’m getting nothing either way.

Task<ResultSet> task = mySQL.QueryResult(myQuery, myParams);

task.Wait(); // hangs here

if I remove the wait, the .IsCompleted flag returns false.

Thanks @Syntasu I am going to try this tonight!

Yes, there is also a way to force the mysql auth mode, pretty sure it’s somewhere on this thread.

I didn’t know you could force it during connection, thought that was only during installation. TIL I guess.

As for my issue with C# and tasks, I know I’m doing something wrong. Just wondered if anyone else had any insight as it is just getting the task to run and waiting on it.

Edit: So my query is waiting to run… least I’ve got something.

Edit: 4 hours later… no progress, cannot get the task to run or stop hanging up the FiveM Server.

@Syntasu What version do you recommend?

@kack8457 MySQL 5.7 is good enough, else the information below for MySQL 8.x;

1. executing the install file
2. select "Reconfigure" over the mysql server
3. In Authentication Method tab, select "Use Legacy Authentication Method"

I think I fixed it. All users have mysql_native_password, but now I have this error. Didn’t before.

@kack8457 That error is due to missing your MySQL User name hense the ''@localhost and also no password being passed.

Note: Do not post your database location, username or password

Edit: For myself and C# … I think I might now get it > https://www.youtube.com/watch?v=2moh18sh5p4

Lets say that i wanna change this exemple with a mysql Async to a ghmattimysql

	MySQL.Async.fetchAll('SELECT `xp` FROM users WHERE identifier = @identifier', {
		['@identifier'] = xPlayer.identifier
	}, function(result)

become:

	Exports['GHMattiMySQL']:QueryScalar('SELECT `xp` FROM users WHERE identifier = @identifier', {
		['@identifier'] = xPlayer.identifier
	}, function(result)

or:

	Exports["GHMattiMySQL"].execute('SELECT `xp` FROM users WHERE identifier = @identifier', {
		['@identifier'] = xPlayer.identifier
	}, function(result)

Thanks

Believe it would be the latter given the weak documentation.

then…
exports.ghmattimysql:execute

Pretty much, from what I can tell thats the path to take.