logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 10-11-2011, 05:48 PM   #1
Austintxous
 
Join Date: Aug 2011
Location: Austin, Texas USA
Posts: 26
Default MySQL Database connection not working

Dreamweaver fails to recognize a mySQL database. I have a valid database on my web provider, Codero.com. I checked with their admin to make sure the port is correct and that the database is running. It is. I also have been able to connect to the database from the MySQL Workbench running on my local machine. But Dreamweaver doesn't see it.

There must be some basic kernel of knowledge I'm lacking, because it looks so simple.
Here's the information Dreamweaver requires. I have set up a temporary account for the awesome person or persons who will take up the chalice and help me work this out.

MySQL server : 68.168.107.106
UserName: tempuser
Password: temppw
Database: bizzocalldata
The port that is open for this is 3306, although Dreamweaver doesn't ask.
Thanks!
Austintxous is offline   Reply With Quote
Old 10-11-2011, 05:57 PM   #2
Corrosive
Corrosive's Avatar
 
Join Date: Feb 2008
Location: Bristol, England
Posts: 7,103
Default

I'm not sure how they do things in Austin Texas but shouldn't you be developing locally and then putting the whole thing live when it is completed?
Corrosive is offline   Reply With Quote
Old 10-11-2011, 06:15 PM   #3
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

Yes, this is kind of upside-down. But I doubt the Austin location is the cause since it holds the largest web geek convention in the world every March

3306 is the default port afaik.

But I would still make sure you develop locally, and then upload the application to the production server when it's done.

.
domedia is offline   Reply With Quote
Old 10-11-2011, 06:24 PM   #4
Austintxous
 
Join Date: Aug 2011
Location: Austin, Texas USA
Posts: 26
Default

We do things different here in Texas. I like to know that I'm going to be able to hit my target first. Then I'll back up. That said, I can't make Dreamweaver hook up to the localhost database either. But nobody can help me debug a localhost connection. This is why I provided a link to a server I want to run data from in production.
:<)Austintxous
Austintxous is offline   Reply With Quote
Old 10-12-2011, 02:13 AM   #5
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

try this to test your local databases, it should display your table names so shows connection.
I tried with your IP address you gave but got nada, are you certain your server allows remote connection , many disable this unless you specify an IP exception

of course edit the db name, user and password
Code:
<?php
$db = new PDO('mysql:dbname=bizzocalldata;host=localhost', 'tempuser', 'temppw');
$result = $db->query("show tables");
while ($row = $result->fetch(PDO::FETCH_NUM)) {
    var_dump($row[0]);
}
?>
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 10-12-2011, 03:31 AM   #6
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

ok disregard that just connected using heidi sql to your databases
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 10-12-2011, 03:41 AM   #7
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

ok i tried in DW 2 ways using PDO and a usual MYsql connection both worked.
Code:
<?php
# FileName="Connection_pdo_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_remote = "68.168.107.106";
$database_remote = "bizzocalldata";
$username_remote = "tempuser";
$password_remote = "temppw";
$connStr = 'mysql:host=68.168.107.106;dbname=bizzocalldata';
$user = 'tempuser';
$pass = 'temppw';
set_exception_handler('exceptionHandler');
try
{
$conn = new PDO($connStr, $user, $pass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e)
{
showError("Sorry, an error has occurred. Please try your request
later\n" . $e->getMessage());
}
?>

or basic mysql

Code:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_new = "68.168.107.106";
$database_new = "bizzocalldata";
$username_new = "tempuser";
$password_new = "temppw";
$new = mysql_pconnect($hostname_new, $username_new, $password_new) or trigger_error(mysql_error(),E_USER_ERROR); 
?>
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas

Last edited by edbr; 10-12-2011 at 03:44 AM..
edbr is offline   Reply With Quote
Old 10-12-2011, 09:06 PM   #8
Austintxous
 
Join Date: Aug 2011
Location: Austin, Texas USA
Posts: 26
Default

Great! Thanks for your help. What I was doing wrong was to assume that the "built in" features of Dreamweaver concerning database connections were actually working. Apparently they are not.
The php/mysql method is the way to go. I was just going down the wrong road. Thanks for pointing the way.

I've actually tried to get Adobe to help me with this, and they won't touch it. I wish the wouldn't put these "red herrings' in their software to clog up the works! Its complicated enough without useless features that don't work...

Thanks again!
Austintxous is offline   Reply With Quote
Old 10-13-2011, 02:00 AM   #9
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,175
Default

both those connection scripts were created by dreamweaver, i used them as you were asking, but they did work. it would be better for you to use your own code though as the built in dreamwever stuff is made for multiple possibilities and is bloated code , very hard to debug .
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 10-14-2011, 05:05 PM   #10
Austintxous
 
Join Date: Aug 2011
Location: Austin, Texas USA
Posts: 26
Default

How do you get Dreamweaver to write the connection script? I can't get it to do anything with a database, even though I can view my files on a remote server, upload and download via FTP.
I'm missing something...
Austintxous is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:53 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com