connect to mysql over ssh tunnel


I have the code below, and i get an error

Unknown MySQL server host ''

[code]dim db as new SQLDatabaseMBS

#if TargetWin32 then
db.SetFileOption db.kOptionLibraryMySQL , GetFolderItem(“libmysql.dll”)

db.DatabaseName = “mysql:”
db.UserName = settings.Uid
db.Password = settings.pwd

i have tunneled the port over ssh using putty
i know the db is available because i can connect using other tools

any ideas what might be the problem?

Yeah, you’ve put too much info in databasename.

Try adding this:

db.port=3306"" Db.databasename="job book"

Thanks Greg,

I dont know if it makes a difference, this is SQLDatabaseMBS.

It does work though if you change the second colon to a comma.

db.DatabaseName = "mysql:,3306@jobbook"

Russ, I use a library from Christian called ‘libmysqlclient.18.dylib’. I also use the following option:

tempSQLDatabaseMBS.Option("MYSQL_SECURE_AUTH") = "true" 'force the use of the MySQL 5+ authentication, rather than pre-4.1.1 tempSQLDatabaseMBS.SQLExecuteMT("SET NAMES utf8 COLLATE utf8_general_ci") 'Define the encoding of the data from the database as UTF8, otherwise the accents go spaz or crashes when adding row in doAddRow