Skip to main content
October 19, 2007
Answered

MySQL Connection to live db

  • October 19, 2007
  • 2 replies
  • 477 views
Hi all,

Some of you may be familiar with David Power's DW and PHP themed books. I have been following his excellent Essential Guide to Dreamweaver CS3 with CSS, AJAX and PHP. I am interested in PHP and how Dreamweaver interacts with databases.

I created a simple db and single table in MySQL on my local machine running apache and using php. The Dreamweaver MySQL connection (accessed through the Applications > Databases panel) worked fine when I set-up a localhost connection and I was able to write records to my db and retrieve/display them through dreamweaver built php pages.

However, when I tried to access the same db (built on my hosting (dreamhost) company's db server) I cannot establish a connection. I get an 1045 access for user@.......com denied (using Password: Yes) error. All I did was change the MySQL server address in the MySQL connections dialog to reflect my hosts db address but this is not being recognised by Dreamweaver. I deleted the _mmServerScripts folder and contents and rebuilt the folder from scratch and uploaded it to my remote server root but that had no effect.

Disappointingly, I have had no response to this question, which I posed on the Friends of Ed Forum (the publisher of the book that I am following) and I wondered if you guys had any idea of what I am doing wrong, or what strange behavior Dreamweaver is exhibiting here?

Thanks in advance for any ideas or hopefully solutions!

This topic has been closed for replies.
Correct answer
Are you really accessing the DB remotely? You DW code is on the remote box so the DB is accessed locally w.r.t. the DW code.
In the terminology that I used...yes. The db is hosted remote from the terminal from which I am trying to access it. The two entities are on separate machines. I am therefore trying to access a db that is remote from my location. DW may well send code to the dbs server to allow me acces to the db but my use of the term remote refers to the physical location of the db in relation to the location of the terminal trying to access it.

Back to the point....

The problem seems to be solved in so much as I now have a successful MySQL connection through DW. This was achieved by enabling third party (remote) access to the db on the hosting server by adding security access protocols to the host's access controls. I say seems to be solved because I now cannot access the db tables and write records. It seems as if the server bahaviors in DW are corrupt or the php generated by DW on creating the server behavior has become corrupt. This will probably need a page rebuild to clear the error.

Thanks for all the comments and help.

2 replies

Inspiring
October 19, 2007
Check the permissions for the user your using to access the Db... try
setting the access to "all"

Jeff


"Nick Barling" <webforumsuser@macromedia.com> wrote in message
news:ffau3b$55d$1@forums.macromedia.com...
> Hi all,
>
> Some of you may be familiar with David Power's DW and PHP themed books. I
> have been following his excellent Essential Guide to Dreamweaver CS3 with
> CSS,
> AJAX and PHP. I am interested in PHP and how Dreamweaver interacts with
> databases.
>
> I created a simple db and single table in MySQL on my local machine
> running
> apache and using php. The Dreamweaver MySQL connection (accessed through
> the
> Applications > Databases panel) worked fine when I set-up a localhost
> connection and I was able to write records to my db and retrieve/display
> them
> through dreamweaver built php pages.
>
> However, when I tried to access the same db (built on my hosting
> (dreamhost)
> company's db server) I cannot establish a connection. I get an 1045
> access for
> user@.......com denied (using Password: Yes) error. All I did was change
> the
> MySQL server address in the MySQL connections dialog to reflect my hosts
> db
> address but this is not being recognised by Dreamweaver. I deleted the
> _mmServerScripts folder and contents and rebuilt the folder from scratch
> and
> uploaded it to my remote server root but that had no effect.
>
> Disappointingly, I have had no response to this question, which I posed on
> the
> Friends of Ed Forum (the publisher of the book that I am following) and I
> wondered if you guys had any idea of what I am doing wrong, or what
> strange
> behavior Dreamweaver is exhibiting here?
>
> Thanks in advance for any ideas or hopefully solutions!
>
>
>


October 19, 2007
Take a look in the php file within the Connections folder. Make sure the connection information matches what is expected on the host. localhost may not work and you may have to provide the specific host address. The other info has to match as well (uid, pw, etc.).
October 19, 2007
I should have added more information to my original post. All other MySQL connection requirements are correct, including connection name (irrelevant to this problem), User name, password and database name. The only difference in the MySQL connection settings dialog is the MySQL Server name. 'Localhost' is not a sufficient name for my hosting company as they use different servers to house the dbs. I have to use the correct db server address, which I have done.

I am now thinking that this is a hosting company security measure that prevents the automatic ability to access db servers from third party machines. If anyone has any other ideas please let me know. When I find a solution I will post it here for other users benefit.

Thanks for the reply.
October 19, 2007
Are you really accessing the DB remotely? You DW code is on the remote box so the DB is accessed locally w.r.t. the DW code.