VB.NET: The type initializer for 'MySql.Data.MySqlClient.Replication.ReplicationManager' threw an exception

前端 未结 5 1957
逝去的感伤
逝去的感伤 2021-01-28 07:39

I don\'t know what may be wrong but that\'s what I get when I try to start the program:

The type initializer for MySql.Data.MySqlClient.Replication.ReplicationMana

相关标签:
5条回答
  • 2021-01-28 08:01

    I guess the problem is with your connection string

    For instance your connection string should be like this

    Server=myServerAddress; Database=myDataBase; Uid=myUsername; Pwd=myPassword;
    

    To know more Click Here..!!!

    Hope this helps

    Happy Coding

    0 讨论(0)
  • 2021-01-28 08:10

    It could be a bad reference to the DLL. Make sure the dll is the right verson for the .net you're using. I also had the same issue and found that in the app.config file i was defining log4net configurations for my logger and that was the issue. i had to define a different config file for log4net so that mysql would work.

    0 讨论(0)
  • 2021-01-28 08:14

    Are you sure with that connection string?! Try to change it to:

    conn.ConnectionString = "server=127.0.0.1;uid=root;pwd=test;database=snipper;"
    

    Follow this reference:

    http://dev.mysql.com/doc/refman/5.0/en/connector-net-programming-connecting-connection-string.html

    0 讨论(0)
  • 2021-01-28 08:21

    Just found the problem... I hadn't enable "SQL Server Debugging". It worked well when I did. Thanks everyone!

    0 讨论(0)
  • 2021-01-28 08:22

    I had the same error, but a different solution. First I tried the enable "SQL Server Debugging", but that didn't change anything (I still don't know why this setting would make a difference).

    The solution for me was the user rights on the server. The application runs with the Task Scheduler under a user account. Only the domain of this user account was changed. So the MySQL Connection didn't have enough rights.

    0 讨论(0)
提交回复
热议问题