Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Connecting to GoDaddy/MySQL

Guest
Jun 01, 2012 Jun 01, 2012

I'm building a website that needs to connect to a MySQL db. I've created the db and a table on the host server (GoDaddy), I've also created a form on the host server web site, now I need to create a connection record. I complete the information requested in DW CS4, click "Test" and it fails immediately with "an unidentified error has occurred". The speed of the failure message suggests to me that it's not even reaching the server so I'm wondering if there are any other settings I should be using. The ones I have are:

  • Connection name
  • MySQL Server
  • Username
  • Password
  • Database

I've checked the Connection record and compared it with other hosts I use, the only difference seems to be the other host has an IP address for the MySQL (I tried using the ip address shown by GoDaddy and had the same error message.

I'm at a loss to know where to look next. Any ideas I'd really appreciate. Using DW CS4/ Win7

Thanks,

Tony

TOPICS
Server side applications
9.9K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Jun 04, 2012 Jun 04, 2012

OK, I never thought I'd be happy to see an error message "http: 503 Service unavailable" - but that's better than "unidentified error" !! It turned out that I had not defined PHP MySQL as the Server Model for the Testing Server in the site definition. Googling this it said this was a temporary condition that should clear up on it's own. So far an hour has gone by and no luck. Next stop will be GoDaddy Tech Support - for the 4th time in this saga!!

After an hour or so with Stephen, a very helpful

...
Translate
Community Expert ,
Jun 01, 2012 Jun 01, 2012

If you are on a shared account and you use "localhost" for your mySQL scripts, the mySQL server should be "localhost".

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 04, 2012 Jun 04, 2012

I don't think this applies - but I could be wrong. I'm not using a local testing server, I'm testing direct on GoDaddy. Thanks for the feedback

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 04, 2012 Jun 04, 2012

This is driving me nuts. I was able to successfully connect from the GoDaddy hosted web site to a MySQL db on another site not hosted by GoDaddy, I was also able to successfully connect from a web site not hosted by GoDaddy to the MySQL db hosted by GoDaddy. What I'm unable to do is connect my GoDaddy site to the GoDaddy MySQL db !! GoDaddy has provided me with a generic piece of PHP which they call a connection string, it is shown below and needs to be customized for my site, the question I have is where do I put this PHP and how do I trigger it?   I'd really appreciate some direction on this. Thanks in advance. Tony

<?php

//Sample Database Connection Syntax for PHP and MySQL.

//Connect To Database

$hostname="your_mysqlserver.secureserver.net";

$username="your_dbusername";

$password="your_dbpassword";

$dbname="your_dbusername";

$usertable="your_tablename";

$yourfield = "your_field";

mysql_connect($hostname,$username, $password) or die ("<html><script language='JavaScript'>alert('Unable to connect to database! Please try again later.'),history.go(-1)</script></html>");

mysql_select_db($dbname);

# Check If Record Exists

$query = "SELECT * FROM $usertable";

$result = mysql_query($query);

if($result)

{

while($row = mysql_fetch_array($result))

{

$name = $row["$yourfield"];

echo "Name: ".$name."<br>";

}

}

?>

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 04, 2012 Jun 04, 2012

Ok, so "localhost" won't be the answer because in your situation the mySQL server is on a different server than the web server.  The mySQL Server is the "your_mysqlserver.secureserver.net".  That address should be the mySQL Server that DW asks for.  Is that what you have tried?

DW creates the connection string but it's asking for the information to your site:

The ones I have are:

  • Connection name
  • MySQL Server
  • Username
  • Password
  • Database

That information coincidences with the document GoDaddy provided.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 04, 2012 Jun 04, 2012

Thanks for your input. Yes the fields above are what it's asking for and I'm giving it exactly what GoDaddy.com tells me, the MySQL Server is w2wb.db.7013538.hostedresource.com I give it the username and password and the database name. What I really don't understand is that if I open another website hosted on a different company's hosting server (using DW with the local web pages on my PC) it tries to connect and gives me an access denied error  which seems reasonable. I also tried including the IP address in the username - the one that I get from PHPMyAdmin and it made no difference.

GoDaddy seems pretty  weak in their support area for connection problems, my previous reply includes a chunk of sample PHP they provided but with no guidance on how to use it. Do you have any idea how I would use this, or even launch it? if I implement this I'm afraid I'll cause other DW problems down the line.

Looking at my web site I don't see an _mmServerScripts folder, which my other website has. Is this created when the connection record is created?

Really out of my depth here, thanks for any suggestions or insights.

Tony

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jun 04, 2012 Jun 04, 2012

OK, I never thought I'd be happy to see an error message "http: 503 Service unavailable" - but that's better than "unidentified error" !! It turned out that I had not defined PHP MySQL as the Server Model for the Testing Server in the site definition. Googling this it said this was a temporary condition that should clear up on it's own. So far an hour has gone by and no luck. Next stop will be GoDaddy Tech Support - for the 4th time in this saga!!

After an hour or so with Stephen, a very helpful tech support guy at GoDaddy, neither of us could figure out what was wrong so we decided the best way forward was to try redefining the site again in DW and pointing it to the site under development. This worked.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 19, 2014 Dec 19, 2014
LATEST

Hi,

I did it successful by the following procedure.

1. Delete first  _mmServerScripts folder and connection folder in the Dreamweaver.

2. Godaddy using phpMyAdmin for sql database. you create one more ( I don't know why this way it makes connection perfect) user with full privilege for your database.

3. Make a note of database server ip details.

4. After doing all above enter the

Connection name -> As you like

  • MySQL Server -> ip address
  • Username -> database user name (just you created)
  • Password -> database password
  • Database -> Click select then this will give the list of database you are having in Gadaddy phpMyAdmin and select which you want.

This procedure worked me many projects in Dreamweaver and Godaddy database. Please let me know is there any issue.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines