I've searched around for an answer to this, and didn't yet find one that I either understand or one the actually meets my needs. Maybe the wizards here can help? :)

While at work, I access my magento store which I currently have on my 'test server' running on a hosted server. I have that in git, pushing to bitbucket.

When at home (and wanting to get some extra work done) I pull from bitbucket to my local machine (using sourcetree).

Everything looks to be working fine. However, the million dollar question > I want to work on the same copy (or a copy) of the test sever database. If I add some new test products for example while at work, I want to see those on my home localhost.

How can I link to the remote database then? Links to guides designed for idiots would be greatly appreciated :)


1 Answer 1


You might need to create a user able to access to your mysql installation from the outside. Normally mysql only accepts local connections but you can make it accept any connections from a remote host. This is not recommended for an online store, but if you need this just for developing it can be done. Complete guide here

After that, you will need to point your local.xml to the correct database with the ip and the mysql credentials you created.

Another option is to replicate the db with mysql replication

  • for idea 1, thats sounds good and i will check. However, is this something your normal hosting provider will allow? I'm thinking maybe not, but I'll need to ask.
    – egg
    Jun 9, 2014 at 19:53
  • I made that with several hosting providers, but i always had VPS or a dedicated hosting account with SSH access, so i made it myself.
    – mbalparda
    Jun 10, 2014 at 9:45
  • Ok, my host actual provided a setting to give remote access to the SQL database, which is good. However, now my localhost redirects to the live. I've cleared the cache, and changed the settings in local.xml - but no go. any idea?
    – egg
    Jun 10, 2014 at 14:37
  • Yes, there are some more things to keep into consideration. One is to point the same domain name in your hosts file to your local installation. And the second is that you will be seeing in the live domain the local installation. You are telling Magento to use a database with a different base url than the one you were using, so you will have to configure it like the live environment but pointing to your local ip ( in the hosts file.
    – mbalparda
    Jun 10, 2014 at 14:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.