Page 1 of 1

using on-rev's database problem

Posted: Sat Sep 08, 2012 11:37 pm
by fenick
Getting an error message when I try to connect to a datbase I created n on-rev.


HEre is the code I try to connect with some commets to help you help me debug it

Code: Select all

on preOpenCard
   -- This opens the connection to the database and makes sure no problems exist
  -- the forum will not let me upload and urls so I replaced the . below with (dot)
   put "thor(dot)on-rev(dot)com" into gDBHost --the domain with the cpanel I created the SQL
   put "mypassword" into gDBPassWord
   put "human_tutor" into gDBUserName --the username I created for this db
   
   databaseConnect("humansiz_test") --the name of the db I created
   -- Show the first available record:
   goNext 0
   if the result is not empty then
      -- database exception handling goes here
   end if
end preOpenCard

on databaseConnect tDB
-- this only works with Mysql
    get revOpenDatabase("mysql", gDBHost, tDB, gDBUserName, gDBPassWord)
   
  if it is not an integer then
    error "Could not connect to database:" && it
  end if
  put it into sDatabaseId
end databaseConnect
I get the error:
Access denied for user 'human_tutor'@<domainname removed be me so I can post this>t' (using password: YES)

I know that username exists, and I have the pw for it... I am thinking I am not identifying the DB properly within on-rev... anyone else have a sample script that works wth on-rev.

Thanks,
-Nick

Re: using on-rev's database problem

Posted: Sat Sep 08, 2012 11:50 pm
by bangkok
On the on rev cpanel , look into "remote mysql".

have you typed your IP address ?

or used the "wildcard" % to authorize any remote IP address to connect to your on rev mysql database ?

Re: using on-rev's database problem

Posted: Sun Sep 09, 2012 3:43 am
by fenick
On the on rev cpanel , look into "remote mysql".

have you typed your IP address ?

or used the "wildcard" % to authorize any remote IP address to connect to your on rev mysql database ?
That was the issue. Thanks!

I know this is bad security practice to be doing this from the client side. But I am teaching myself livecode at the moment and want to go step by step with little projects until I'm ready to do it server side via cgi.