connecting to mysql
Mark Smith
Mark_Smith at cpe.umanitoba.ca
Fri Sep 28 23:59:37 EDT 2012
Hi, I'm looking for a test site I could use to test some code. I've got the
following working for a localhost config but am getting an error connecting
to the remote host at www.runrev.com. Does anyone have another remote site I
could test this with?
on mouseUp
-- use a global variable to hold the connection ID so other scripts can
use it
global gConnectionID
-- set up the connection parameters - edit these to suit your database
-- put "www.runrev.com" into tDatabaseAddress
-- put "runrev_test" into tDatabaseName
-- put "example" into tDatabaseUser
-- put "example" into tDatabasePassword
put "localhost" into tDatabaseAddress
put "learnsql" into tDatabaseName
put "root" into tDatabaseUser
put "root" into tDatabasePassword
-- connect to the database
put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName,
tDatabaseUser, tDatabasePassword) into tResult
-- check if it worked and display an error message if it didn't
-- & set the connection ID global
if tResult is a number then
put tResult into gConnectionID
answer info "Connected to the database." & cr & "Connection ID
= " & gConnectionID
else
put empty into gConnectionID
answer error "Unable to connect to the database:" & cr &
tResult
end if
end mouseUp
Also, if your site uses port numbers I'd like to try that as well with
something like this code:
revOpenDatabase ("mysql",host[:port], databaseName, [userName], [password],
[useSSL], [socket], [timeout], [autoReconnect])
BTW, the error I am getting at www.runrev.com is
Host 'wnpgmb014uw-ad04-17-21.dynamic.mtsallstream.net' is not allowed to
connect to this MySQL server
Thanks
-- Mark
--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/connecting-to-mysql-tp4655547.html
Sent from the Revolution - User mailing list archive at Nabble.com.
More information about the use-livecode
mailing list