Skip to main content
Known Participant
November 23, 2010
Question

Confused, which MySQL database to connect to: local (WAMP), or remote?

  • November 23, 2010
  • 2 replies
  • 1106 views

Hello, new to dynamic sites, have successfully installed WAMP and set up my local/testing/remote sites in DW CS4.  Most tutorials I've found recommend making the "MySQL Connection" in Dreamweaver to the local (WAMP) installation of MySQL, which I am able to do.  But my remote site already has an existing MySQL database and tables.  So should I be making the MySQL Connection to the remote database instead?  Or exporting the remote server's database and importing it locally for development purposes?  What's the best practice?

If making the connection to my local database is recommended, how do I transfer any changes that I make on my local db to the remote database?  Do I need to export locally & import to the remote db, using phpmyadmin, every time I make changes to the local database?

If making the connection to my remote database is recommended, I have 2 questions: 1) do I even need my local WAMP MySQL database for anything?  and 2)  I was able to connect to my remote MySQL, (first got "MySQL ERROR 1045 Access Denied", but then went into my remote server via CPanel, found the "Remote MySQL" function, and entered my long current domain name as a new Access Host), but since I'm at a home office without a static IP, will I have to keep going into CPanel and entering in a new Access Host every time my IP address changes?

Apologies for the confusion.  Any pointers to recommended best practices would be much appreciated.

- Frank

This topic has been closed for replies.

2 replies

fbherrAuthor
Known Participant
November 29, 2010

> 2)  I was able to connect to my remote MySQL, (first got "MySQL ERROR  1045

> Access Denied", but then went into my remote server via CPanel,  found the

> "Remote MySQL" function, and entered my long current domain  name as a new

> Access Host), but since I'm at a home office without a static IP,

> will I have to keep going into CPanel and entering in a new  Access Host every time

> my IP address changes?

Update: my IP address changed slightly yesterday and I was denied remote MySQL access again.  Went back to CPanel and modified my Access Host domain with a few wildcard characters (blah-blah-blah-%%%%.dsl.bell.ca).  That got me back in.  Is this what most people who want remote MySQL access do?  Is it a (significant) security risk?

Or do most people without static IPs just not bother with remote MySQL access?

November 24, 2010

What I do is I create 2 connection include files, one for the local, one for the remote.  After I am done testing locally, I change the to the remote include file which will connect me to the remote DB.

I dont tend to keep my local DB  up to date, whether that is a smart idea or not, I dont know.  But I simply export the db file from myphpadmin and save it as a backup.  You can import it to your local DB if you like, but unless you are testing something to work out the bugs, I'm not sure I see the advantage.

Hope that helps.

Gary

fbherrAuthor
Known Participant
November 24, 2010

Thanks Gary, that is indeed helpful. So if, for example, you're adding new tables to your database, do you do that on your local MySQL connection, and then export it to your remote MySQL db once you've got it all set up and working the way you want it to?  Or do you use your remote db connection to do things like that, where you're adding new tables or records to your site's database?

- Frank

November 24, 2010

Once I have the table and queries working, I work remote. Adding a new table, I stay remote. Now if you are doing something a little more complex, like joins or adding multiple tables that affect a shopping cart, I might be tempted to go local.

Keep in my that many servers do not allow Dreamweaver to connect directly, so you have to develope locally, but once you have the basics of your DB and connections all worked out...I dont bother with the local.

But that is me.  Maybe someone has a reason to work more local that I have not thought of.

As far as trying to keep the two of the identical with regards to data, I dont.

Gary