Hi guys I have moved off PC and onto Apple.
I have MySql and Navicat for MySQL on my Mac. I can open up my database with MySql with no problem.
I have taken the code off my PC and onto my MAC and cannot connect to my database through my local port. The error i get is:
"Unable to connect to database: Can't connect to local MySql server through socket '3306' (2)"
What should I change?
-- set up the connection parameters - edit these to suit your database
put "localhost" into tDatabaseAddress
put "plascondropanalysisdb" into tDatabaseName
put "root" into tDatabaseUser
put "" into tDatabasePassword
put "localhost" into tDatabaseAddress
put "plascondropanalysisdb" into tDatabaseName
-- connect to the database
put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword,False,3306, 0, True) into tResult
Apple MacBook Pro (Retina) connecting to a MySQL database
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Apple MacBook Pro (Retina) connecting to a MySQL databas
Hi Gary,
some observations reagarding "revopendatabase":
1. The dictionary tells to use "mysql" no capitals!
-> revOpenDatabase("mysql"...)
2. Are you sure that 3306 is really a SOCKET number? Maybe it's just the PORT you want to use to connect?
-> revOpenDatabase("mysql","localhost:3306",...)
So try this:
...
put "plascondropanalysisdb" into tDatabaseName
put "root" into tDatabaseUser
put "" into tDatabasePassword
put "localhost:3306" into tDatabaseAddress
put "plascondropanalysisdb" into tDatabaseName
put revOpenDatabase("mysql", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword,False,, 0, True) into tResult
...
Not sure, but at least worth a try
Best
Klaus
some observations reagarding "revopendatabase":
1. The dictionary tells to use "mysql" no capitals!
-> revOpenDatabase("mysql"...)
2. Are you sure that 3306 is really a SOCKET number? Maybe it's just the PORT you want to use to connect?
-> revOpenDatabase("mysql","localhost:3306",...)
So try this:
...
put "plascondropanalysisdb" into tDatabaseName
put "root" into tDatabaseUser
put "" into tDatabasePassword
put "localhost:3306" into tDatabaseAddress
put "plascondropanalysisdb" into tDatabaseName
put revOpenDatabase("mysql", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword,False,, 0, True) into tResult
...
Not sure, but at least worth a try

Best
Klaus
Re: Apple MacBook Pro (Retina) connecting to a MySQL databas
Klaus, you are a star... it works... thank you
Re: Apple MacBook Pro (Retina) connecting to a MySQL databas
Hi Gary,
But I just had a deeper look at the dictionary entry for "revopendatabase"
Best
Klaus
I know!garyb wrote:Klaus, you are a star...

But I just had a deeper look at the dictionary entry for "revopendatabase"

Best
Klaus