PDA

View Full Version : MySQL Database connection not working


Austintxous
10-11-2011, 04:48 PM
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!

Corrosive
10-11-2011, 04:57 PM
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?

domedia
10-11-2011, 05:15 PM
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 (http://forums.adobe.com/thread/659819) afaik.

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

.

Austintxous
10-11-2011, 05:24 PM
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

edbr
10-12-2011, 01:13 AM
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
<?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]);
}
?>

edbr
10-12-2011, 02:31 AM
ok disregard that just connected using heidi sql to your databases

edbr
10-12-2011, 02:41 AM
ok i tried in DW 2 ways using PDO and a usual MYsql connection both worked.
<?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

<?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);
?>

Austintxous
10-12-2011, 08:06 PM
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!

edbr
10-13-2011, 01:00 AM
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 .

Austintxous
10-14-2011, 04:05 PM
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...

domedia
10-14-2011, 06:57 PM
What exactly are you doing, Austin? Step by step. You're missing something.

Have you gone through the manual and make sure you're doing this right? As Ed said, the connection to the database works fine. Use them in DW, upload your changes, and test in browser.

domedia
10-14-2011, 06:58 PM
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. Can you explain exactly what is happening when "Dreamweaver doesn't see it"? It's so open for interpretation.

edbr
10-15-2011, 01:02 AM
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...

open a php page> depending on your dw version ( i think) go to the database panel , click +, then select mysql connection. in the dialogue box i filled the ip address,user and password clicked test and it shows the databases available

Austintxous
10-16-2011, 03:51 AM
I've actually got it working now, by using connection scripts in PHP. It would be "nice" to be able to look at the database in Dreamweaver, but I'm getting used to the MySQL Workbench that Oracle provides for free. Its pretty nice.
Anyway, I'm not going to waste any more time trying to figure out why this feature isn't working in Dreamweaver. I can do without it...

edbr
10-17-2011, 02:39 AM
isnt that a seperate mysql manager tool? similar is EMS, sqlyog and heidisql all are free but do not intergrate into dreamweaver. If you wanr an IDE you could look at, Codelobster, Aptana, Komposer or maybe even htmlkit. If you use dreamweavers live view it is a fairly good debug or testing your data. much faster of course if you test locally