connecting to mysql db hosted on 1and1

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

connecting to mysql db hosted on 1and1

Post by sms5138 » Wed May 06, 2015 7:15 pm

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

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: connecting to mysql db hosted on 1and1

Post by bangkok » Thu May 07, 2015 8:06 am

-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

sms5138
Posts: 126
Joined: Mon Feb 23, 2015 11:49 pm

Re: connecting to mysql db hosted on 1and1

Post by sms5138 » Thu May 07, 2015 7:56 pm

Thanks bangkok!

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

-Sean

Post Reply