Page 1 of 1

connecting to mysql db hosted on 1and1

Posted: Wed May 06, 2015 7:15 pm
by sms5138
Hi everyone,

I'm having a bit of trouble connecting to a mysql database that's hosted on 1and1. here is the code i currently have:

Code: Select all

   global gConnectionID
   

   put "dbXXXXXXX.db.1and1.com" into tDatabaseAddress
   put "dbXXXXXXX" into tDatabaseName
   put "dbXXXXXXX" into tDatabaseUser
   put "XXXXX" into tDatabasePassword
   

   put revOpenDatabase("MySQL", tDatabaseAddress, tDatabaseName, tDatabaseUser, tDatabasePassword) into tResult

   if tResult is a number then
      put tResult into gConnectionID
      answer "it worked"
   else
      put empty into gConnectionID
      answer error tResult
   end if
Any advice on how i may be able to resolve this? has anyone else tried to host their DB on 1and1?

Thanks in advance!

-Sean

Re: connecting to mysql db hosted on 1and1

Posted: Thu May 07, 2015 8:06 am
by bangkok
-did you set the proper parameters, on the server side ?

-does the user have the right to connect "remotely" to the mysql server ?

-usually it's something you can set via phpmyadmin for instance (if your server is a regular web hosting service)

-basically it will add a "wildcard" (%) to the user, allowing all IP addresses

-but if you do so, you have to remember that your database will be "exposed"

-if you intend to connect from always the same IP address, then you can restrict the access to this very same IP address. it's better than nothing

-but usually, it's not recommanded to allow remote connexions

-people usually use a "layer" between the mysql server and the users : a set of php or livecode server scripts that will receive queries and forward them to the mysql server

-peruse the archives on this forum : you'll find many articles about this

Re: connecting to mysql db hosted on 1and1

Posted: Thu May 07, 2015 7:56 pm
by sms5138
Thanks bangkok!

That was really helpful. I believe got it up and running!

-Sean