Page 1 of 1
MySQL Connection failure
Posted: Wed Jul 17, 2013 5:56 am
by MrWizard.
I am attempting to connect from UNIX server A to UNIX server B.
The connection string properly functions from the command line using mysql CLI
When running the connection string from server A via LC;
=========
try
get revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword)
put the result into tResult
catch errorParameter
put "<p>Unable to connect to the database. Return Code [" && errorParameter && "] </p>" && CRLF
breakpoint
end try
=========
The following error string is returned;
Unable to connect to the database. Return Code [ 219,37,6,revOpenDatabase 223,37,1 ]
Any documentation available to diagnose these codes?
Thanks,
E
Re: MySQL Connection failure
Posted: Wed Jul 17, 2013 11:11 am
by Klaus
Hi E,
I think the database names are case sensitive, try:
---
get revOpenDatabase("mysql", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword)
...
Best
Klaus
Re: MySQL Connection failure
Posted: Wed Jul 17, 2013 6:43 pm
by jacque
Those errors look like the ones that LiveCode generates, which means a script problem. You can look up what they mean. The dictionary entry for "errorDialog" tells you where to find the translations, or you can use a handy lookup stack available in the User Samples (on LiveCode's toolbar.) Search for a stack there named "LiveCode Error Lookup". The first number in the trio is the one you want to translate.
Re: MySQL Connection failure
Posted: Wed Jul 17, 2013 8:15 pm
by MrWizard.
Thanks!
I can now parse the error strings;
An error occurred. Error Code [ 219 ] Line Number [ 44 ] Column-number [ 6 ]
Line 44 is the suspect open database connection statement;
put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult
Column 6 is the user name;
tDatabaseUser
Error Code 219 is "Function: error in function handler"
I am confident the account is not suspect as;
- I can execute the same script from a MAC client connecting to the target server using the same parameters
- I can connect from the target server via the command line mysql tool using the same parameters
- I can connect from another UNIX server via the command line mysql tool using the same parameters
- I can connect from MySQL work bench from a MAC client using the same parameters
What does the error code 219 tell me?
Since this is a server based CGI script, do i need to explicitly include any statements for library or externals?
I have the statement [set the errorMode to "inline"] in the script but that does not seem to add any additional diagnostic data.
Thoughts?
I hate to have to adapt by design to accommodate something that should be working.
Could it be a path or permissions problem on the CGI server?
E
Re: MySQL Connection failure
Posted: Wed Jul 17, 2013 8:23 pm
by MrWizard.
"Connected to the database. Connection ID = 1"
Turns out the cgi-bin files were not set to 755, so it was failing!
Thanks for your help!
E