Copy link to clipboard
Copied
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:
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
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
...Copy link to clipboard
Copied
If you are on a shared account and you use "localhost" for your mySQL scripts, the mySQL server should be "localhost".
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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>";
}
}
?>
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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
This procedure worked me many projects in Dreamweaver and Godaddy database. Please let me know is there any issue.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now