Link to home
Start Free TrialLog in
Avatar of napsternova
napsternovaFlag for United States of America

asked on

How can I connect to my Database via GoDaddy?

Hi,
Well I am using Dreamweaver and although there are a lot of discussions regarding this topic I have yet to figure out what my issue is.  I cannot connect to my database via the Dreamweaver wizard.  Can I just bypass the wizard and hand code my own connection file?  I am using PHP/MySQL.  I can connect to the FTP  I have spent 2 days on this.  I get code error 404.  There is no testing server running.

Please help!
Avatar of Jason C. Levine
Jason C. Levine
Flag of United States of America image

Hi napsternova,

You can create your own connection file but DW will probably not recognize it and let you use it in conjunction with its wizards.  If you are a hand-coder and not using the wizards, then go for it.

Otherwise, you need to work with GoDaddy support to fix the issue.  It is usually caused by some incorrect setting (either you have the name of the server wrong or the wrong login credentials OR the database user is restricted from accessing the database in some way -- domain name or IP address are common).   This is a fairly endemic problem with GoDaddy but I've seen it fall both ways.
sometimes where the connection says "local server" i.e. 127.0.0.1  or what ever it is
find out the actual IP address of where the database is  and use that - or if you are using the actual IP address try the local 127.0.0.1 one.....
Godaddy MySQL connections are strictly Local unless you set it up otherwise.  I have one setup for remote connections and it works from this computer.  It uses the standard connection setup for PHP/MySQL.
Avatar of napsternova

ASKER

Dave,
So you are able to use Dreamweaver?  I have never had this type of issue before.  I created a new database and I have it set up to allow remote access.  I like the simplicity of drag/drop dynamic fields and text but without a connection I cannot create a recordset.
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The above will "work" in Dreamweaver in the sense that it's perfectly valid PHP and will allow you to hand-code stuff.  But if you want to work with DW wizards, you have to let DW write its own code.

Dave has it right with http:#a33448903 but you may need to contact GoDaddy support to make sure that you are indeed set up for remote access and that the user is not limited to a specific domain or ip range.

So since I cannot use Dreamweaver for its intended purpose, is it easy enough to build the site locally and then upload the whole thin and change the database connection parameters?  If this were my site I would find a new host, I've spent 2 days trying to get Dreamweaver to work.  Any ideas for building a contanct management system?
buy one off the shelf or get an open source one for free...
they all come working out of the box

list of open source here...
http://php.opensourcecms.com/scripts/show.php?pagenumber=2&catid=all
>> So since I cannot use Dreamweaver for its intended purpose

Sure you can.  All you need to do here is talk to GoDaddy support and get them to help you with the connection parameters.  Better yet, host elsewhere...there's plenty of low-cost, high-feature hosting to choose from out there.
jason1178,
yeah I talked to them 3 times.  They all seemed interested in helping but when it was all said and done I am here looking for answers.  I keep getting the testing server not active or installed, I forget which.

I would switch but it isn't my site.
Can you connect to the DB through a browser (i.e. use phpMyAdmin)?
This is a bit of a puzzle to me because I used the code I posted above to connect to my MySQL database on my Godaddy Windows IIS7 hosting from this computer running Windows 2000 with IIS5.0 and PHP 5.2.5.  I also use similar code for a customer running on Godaddy Linux hosting.  So the connection details are the same as any other MySQL setup if you have set it up for remote access which is just a checkbox on the setup request.  You have to get the 'connection details' from the database page in the Hosting Control panel.  Other than that, Dreamweaver really shouldn't have a problem with it.  It's plain vanilla stuff.

Which hosting, Linux or Windows, are you using?  And did you try the test page I posted above?
what version of dreamweaver do you have?
jason - yes I can access phpmyadmin
dave - hosting is Linux, what should I save the file as and then where should it be saved.  This site has a bunch of aliases so I am uploading my site to an alias folder.
chilternPC - Dreamweaver CS4
Thanks all  
Dave - OK that file works, I am starting to get really confused.  So do I need to hand code my forms, logins and reports?  
That's a possibility but since I don't have or use Dreamweaver, I suggest you work it out with the others.  Maybe they can tell you how to get Dreamweaver to cooperate since we now know that the connection works.
Try this...

From Dreamweaver, open the FTP log (Windows | Results | FTP log)

Once the FTP log is open, do Site | Advanced | Remove Connection Scripts

You should see some activity in the FTP log that shows a number of files being checked and then removed.

After that's complete, edit your site definition and make sure the testing server settings and remote server settings are correct.  For simplicity, set both of them to be the same (i.e. point the testing server at GoDaddy) and make sure the Host Directory the remote and testing servers are the public site root.

Then switch to the Databases panel and redefine the Connection.  You should see activity in the FTP log as new files are uploaded to GoDaddy.  Open a new page and attempt to create a recordset...
Dave - If I may ask, what do you use?  Seems like Dreamweaver writes extra code that Godaddy doesn't like.  That's fine if the code is cleaner and faster, I can adapt.  Too bad this little job is going into week 2.
jason - will do, thanks
I hand code everything in HTML-Kit.  You saw the code I actually use.  Many, many times.  Well, what follows the connection gets a lot more complicated but that's the way it starts.  I wonder about what Dreamweaver is writing because the code I posted is like the basic code form the PHP demo page.  There are two other ways of doing it.  Maybe Dreamweaver is using one of them.  With your login info removed, can you post the code it's generating for you?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Godaddy MySQL servers for external access are not on the web domain but on a separate domain they have for the servers.
Doesn't matter as far as DW is concerned.  If the mysql user has permission to access the remote server from any IP address and the site definition is correct in DW, it should work.
Wow, I actually got DW to connect and create a Recordset.  I will post my findings
Thank you so much for all your help.  I am not 100% sure why "all of a sudden" it connected but it did.  I will inspect it once I am done with the job.  I split the points because both of you contributed pretty equally.
Thanks.  You probably got all the pieces right.  Glad to help.