Search code examples
mysqlf#type-providers

"CreateSemaphore" error when working with SQLProvider


module test = 

  let [<Literal>] resolutionPath = __SOURCE_DIRECTORY__ + @"/../packages/SQLProvider/lib/"
  let [<Literal>] connectionString = "Data Source=localhost"
  type sql = SqlDataProvider< 
              ConnectionString = connectionString,
              DatabaseVendor = Common.DatabaseProviderTypes.MYSQL,
              ResolutionPath = resolutionPath,
              IndividualsAmount = 1000, 
              UseOptionTypes = true>

This is the exact error message I get

The type provider 'FSharp.Data.SqlTypeProvider' reported an error: CreateSemaphore (FS3003)

Not sure what to do from here, any suggestions would be appreciated!


Solution

  • This error comes from MySQL and not from the typeprovider. I think your connectionstring is not MySQL connection string. Try this:

    let [<Literal>] connectionString = @"server=localhost;database=myDatabase;uid=root;pwd=..."
    

    You can also try to add Owner-parameter to be your database name.