Jump to content

Help! Cannot connect to mysql database through Dreamweaver!


Recommended Posts

Hi there,

 

I have installed PHPMyAdmin in my server and from there I have created a mysql database and a table within it.

 

Now, since I want to create an application Form... I need to connect my database with Dreamweaver.

 

I spend my whole day trying this... and didn't succeed :(

 

Here is what I did in Dreamweaver CS3:

Create a FTP connection with my site and then open MYSQL Connection window:

 

Connection name: mydatabase

My SQL Sever: localhost (I also tried with my IP addresses, and didn't work either)

Username: root (username of www.domain.com/phpmyadmin)

Password: xxxx (same as above/pass)

Database: mydatabase

 

I am getting the message "An unidentifed error has occurred" each time I'm trying this.

 

localhost should be the name of my MySQL Server,... because I've seen it in PHPMyAdmin window

 

Can anybody help me pleaseeeee with this?!

 

Thnx

This will be because you wont have permission to connect to the database from your public IP. You need to grant access using the MySQL GRANT syntax.

Why connect to your database through DW? Can't you write the SQL yourself rather than get DW to do it (DW generates lots of un-necessary crap code) and just upload to the server to test?

Hey Neil,

 

Thanks for your reply. I have imported table to a database. To get that code... I have to go to phpmyadmin/SQL... right? And then, back to Dreamweaver... paste that and upload to the server... ????

 

I assume that I need to add some extra code for this!

 

I appreciate some more help for this...

I would check the privileges for the root user on the database and would also attempt to connect to the database in your code & perform a select command. This would help clarify whether a connection can be made to mysql & data can be returned. If this works then the issue is isolated between Dreamweaver & MySQL.

Thanks for your reply. I have imported table to a database. To get that code... I have to go to phpmyadmin/SQL... right? And then, back to Dreamweaver... paste that and upload to the server... ????

 

It would be much better to just learn sql yourself. It's a very simple language. Also I wouldn't be surprised if the problem was just Dreamweaver.

Yes... I put a code (see below)

 

<?php

$dbhost = 'localhost';

$dbuser = 'root';

$dbpass = 'password';

 

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');

 

$dbname = 'petstore';

mysql_select_db($dbname);

?>

 

I used the same user/pass... host names... like in Dreamweaver and it worked here. So, I assume that the problem is in Dreamweaver.

 

But now... I have to create a form and that's why I need Dreamweaver, otherwise I don't know how to do it!!! Does anybody know how can I combine these things... and make my online appilcation form in DW.

 

Thanks.

If you're going to be doing advanced-ish stuff like this (involving mysql anyway), you should probably learn html and css for designing web pages. wysiwyg editors like dreamweaver usually add a lot of unnecessary code, plus you don't have as much control. www.w3schools.com have some html and css tutorials, or it might even be worth taking out a book on html from your library.

Well... I used those tutorials and they help me a lot! I know how to create a form html/css, but when it comes to MYSQL, it's much more easy for me to create a connection with Dreamweaver to my database (MySQL). I started learning MySQL too... but it will take to much time for my to make this application form, write all those codes... and everything... I don't know if I can find mysql codes for this connection :(

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.