Access to mysql database from windows service
Posted by: Christian Sender
Date: January 13, 2010 03:37PM

Hello,
I wrote an C# application that can be run either as a windows service or as a desktop application. If it is run as a desktop application, no problems occur, every user can connect to the MySql database. If it is run as a service, some users get the following exception:
Connection unexpectedly terminated. StackTrace: bei MySql.Data.MySqlClient.MySqlStream.LoadPacket()
bei MySql.Data.MySqlClient.MySqlStream.ReadPacket()
bei MySql.Data.MySqlClient.NativeDriver.Authenticate411()
bei MySql.Data.MySqlClient.NativeDriver.Authenticate()
bei MySql.Data.MySqlClient.NativeDriver.Open()
bei MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
bei MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
bei MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
bei MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
bei MySql.Data.MySqlClient.MySqlPool.GetConnection()
bei MySql.Data.MySqlClient.MySqlConnection.Open()

The connection string looks like this:
Server=localhost;Port=3308;Database=replication1;User Id=wurzel;Password=chef;Connect Timeout=30;;Ssl Mode=Required

I am using MySql 5.0.45
MySql ADO.NET Connector 6.1.2
No idea how to resolve the problem.

Thanks for help

Christian

Options: ReplyQuote


Subject
Written By
Posted
Access to mysql database from windows service
January 13, 2010 03:37PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.