Попытка подключиться к MySQL, используя беглые nhibernate и Mono ... и получить эту ошибку:
TdsInternalException: Server does not exist or connection refused.
Я знаю, что мои учетные данные mysql работают, потому что не-nhibernate-соединения успешны при создании таблиц, чтении данныхи т. д. Это происходит сбой только при попытке установить соединение с помощью свободно используемого nhibernate
Это строка подключения mysql:
Server=localhost,3306;Database=mydb;uid=theUser;pwd=thePassword
Вот код конфигурации Fluent Nhibernate:
var configuration = Fluently.Configure();
configuration.Database(MySQLConfiguration.Standard
.ConnectionString(sqlConnectionStr));
// mappings
sessionFactory = configuration.Mappings... so on....
Это полная ошибка:
[exec] !! An error has occurred. The error is:
[exec] FluentNHibernate.Cfg.FluentConfigurationException: An invalid or incomplete configuration was used while creating a SessionFactory. Check PotentialReasons collection, and InnerException for more detail.
[exec]
[exec] ---> System.Data.SqlClient.SqlException: Server does not exist or connection refused. ---> Mono.Data.Tds.Protocol.TdsInternalException: Server does not exist or connection refused. ---> System.Net.Sockets.SocketException: Connection refused
[exec] at System.Net.Sockets.Socket+SocketAsyncResult.CheckIfThrowDelayedException () [0x00000] in <filename unknown>:0
[exec] at System.Net.Sockets.Socket.EndConnect (IAsyncResult result) [0x00000] in <filename unknown>:0
[exec] at Mono.Data.Tds.Protocol.TdsComm..ctor (System.String dataSource, Int32 port, Int32 packetSize, Int32 timeout, TdsVersion tdsVersion) [0x00000] in <filename unknown>:0
[exec] --- End of inner exception stack trace ---
[exec] at Mono.Data.Tds.Protocol.TdsComm..ctor (System.String dataSource, Int32 port, Int32 packetSize, Int32 timeout, TdsVersion tdsVersion) [0x00000] in <filename unknown>:0
[exec] at Mono.Data.Tds.Protocol.Tds..ctor (System.String dataSource, Int32 port, Int32 packetSize, Int32 timeout, TdsVersion tdsVersion) [0x00000] in <filename unknown>:0
[exec] at Mono.Data.Tds.Protocol.Tds70..ctor (System.String server, Int32 port, Int32 packetSize, Int32 timeout, TdsVersion version) [0x00000] in <filename unknown>:0
[exec] at Mono.Data.Tds.Protocol.Tds80..ctor (System.String server, Int32 port, Int32 packetSize, Int32 timeout) [0x00000] in <filename unknown>:0
[exec] at Mono.Data.Tds.Protocol.TdsConnectionPoolManager.CreateConnection (Mono.Data.Tds.Protocol.TdsConnectionInfo info) [0x00000] in <filename unknown>:0
[exec] at Mono.Data.Tds.Protocol.TdsConnectionPool.GetConnection () [0x00000] in <filename unknown>:0
[exec] at System.Data.SqlClient.SqlConnection.Open () [0x00000] in <filename unknown>:0
[exec] --- End of inner exception stack trace ---
[exec] at System.Data.SqlClient.SqlConnection.Open () [0x00000] in <filename unknown>:0
[exec] at NHibernate.Connection.DriverConnectionProvider.GetConnection () [0x00000] in <filename unknown>:0
[exec] --- End of inner exception stack trace ---