Embedded Server Setup
-
- Posts: 12
- Joined: Mon 26 Sep 2005 04:33
Embedded Server Setup
I am trying to setup my application with an embedded mysql server in it.
I followed the MySQLDirect .NET instructions on how to obtain and build a libmysqld.dll library (Using version 4.1.18 of mysql source)
Unfortunately, when I attempt to add this library to my project's references I get the following message
A reference to 'C:\mypath\libmysqld.dll' could not be added. This is not a valid assembly or COM object. Only assemblies with extension 'dll' and COM components can be referenced. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
Can anyone shed any light on what I might have done wrong?
I followed the MySQLDirect .NET instructions on how to obtain and build a libmysqld.dll library (Using version 4.1.18 of mysql source)
Unfortunately, when I attempt to add this library to my project's references I get the following message
A reference to 'C:\mypath\libmysqld.dll' could not be added. This is not a valid assembly or COM object. Only assemblies with extension 'dll' and COM components can be referenced. Please make sure that the file is accessible, and that it is a valid assembly or COM component.
Can anyone shed any light on what I might have done wrong?
-
- Posts: 12
- Joined: Mon 26 Sep 2005 04:33
-
- Posts: 12
- Joined: Mon 26 Sep 2005 04:33
I am still having troubles getting an embedded server to work.
I have done the following steps:
- Downloaded mysql installer 4.1.18
- Installed and configured mysql. Tested that it works in client console
- Shut down mysql service
- Copied libmysqld.dll into C:\Windows
I then have been trying various usages of this code...
Everything I try seems to cause an exception at myConn.Open(); and throws this error...
Any help would be appreciated.
I have done the following steps:
- Downloaded mysql installer 4.1.18
- Installed and configured mysql. Tested that it works in client console
- Shut down mysql service
- Copied libmysqld.dll into C:\Windows
I then have been trying various usages of this code...
Code: Select all
MySqlConnectionStringBuilder myCSB = new MySqlConnectionStringBuilder();
myCSB.ServerParameters = "--basedir=C:\Program Files\MySQL\MySQL Server 4.1;--datadir=C:\Program Files\MySQL\MySQL Server 4.1\data;";
//myCSB.Host = "localhost";
myCSB.Embedded = true;
myCSB.UserId = "root";
myCSB.Password = "mypass";
//myCSB.Database = dbaseName;
myConn = new MySqlConnection(myCSB.ConnectionString);
MySqlDataReader myReader = null;
try
{
string myQuery = "show variables";
MySqlCommand myCommand = new MySqlCommand(myQuery);
myCommand.Connection = myConn;
myConn.Open();
myReader = myCommand.ExecuteReader();
while(myReader.Read())
{
string myStr = myReader.GetString(0);
}
}
catch(Exception e)
{
//write error to log file
new error().throwNote("CACHE: Error accessing Embedded MYSQL server - "+e.ToString());
}
finally
{
myReader.Close();
myConn.Close();
}
I am positive I am missing some step but just not sure what.2:13 PM - NOTE: CACHE: Error accessing Embedded MYSQL server - System.ApplicationException: Error in the application.
at CoreLab.MySql.i..ctor(String[] A_0)
at CoreLab.MySql.MySqlInternalConnection.Connect(String userId, String password, String host, String database, Int32 port, Int32 connectionTimeout, MySqlProtocol protocol, Boolean compress)
at CoreLab.MySql.MySqlInternalConnection..ctor(af connectionOptions)
at CoreLab.MySql.a5.a(DbConnectionOptions A_0, Object A_1, DbConnectionBase A_2)
at CoreLab.Common.DbConnectionFactory.a(DbConnectionPool A_0, DbConnectionOptions A_1)
at CoreLab.Common.DbConnectionPoolGroup.c(DbConnectionPool A_0)
at CoreLab.Common.DbConnectionPool.a()
at CoreLab.Common.DbConnectionPool.GetObject()
at CoreLab.Common.DbConnectionFactory.a(DbConnectionBase A_0)
at CoreLab.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
at CoreLab.Common.DbConnectionBase.Open()
at CoreLab.MySql.MySqlConnection.Open()
at DLA.core.cache.MysqlCache.test() in c:\documents and settings\dneilsen\my documents\visual studio projects\timesheet\core\cache\mysqlcache.cs:line 150
Any help would be appreciated.
-
- Posts: 12
- Joined: Mon 26 Sep 2005 04:33
Those paths definetly exist and are setup correctly.
The basedir path has the share directory (and its contents) under it
The datadir path has the contents of the default mysql install data dir in it.
The mysql manual describes the use of several functions
mysql_server_init();
mysql_thread_init();
mysql_thread_end();
mysql_server_end();
Do I have to do something with these? I am not sure how to access them as I am unfamiliar with linking unmanaged librarys.
The basedir path has the share directory (and its contents) under it
The datadir path has the contents of the default mysql install data dir in it.
The mysql manual describes the use of several functions
mysql_server_init();
mysql_thread_init();
mysql_thread_end();
mysql_server_end();
Do I have to do something with these? I am not sure how to access them as I am unfamiliar with linking unmanaged librarys.
-
- Posts: 12
- Joined: Mon 26 Sep 2005 04:33
-
- Posts: 12
- Joined: Mon 26 Sep 2005 04:33