We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25551 ☆ A M B ☆
    • 1,231 Posts
    Hey, I want to setup a demo site for users to check out modx but I want the database to be on a different site. The season is, I’m also having a demo of the control panel for my hosting and customers can actually delete the database for the modx demo. Is there a way that I can install modx on my demo site but access the database from another server? It needs to access the whole database as if it’s a completed install. Hope that make sense.

    Thanks
      Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
      AugmentBLU - MODX Partner

      BLUcart - MODX Revolution E-Commerce & Shopping Cart
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You can access the database from anywhere. I have several sites where the database resides on a different server. Just replace the default "localhost" with the appropriate server name.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 25551 ☆ A M B ☆
        • 1,231 Posts
        Christ, I never even thought about that lol. Ok, I have my config file open and I see localhost. How do I go about accessing a separate database. Instead of localhost do i put http://ip-of-server/localhost/ or is it a little more to it than that?
          Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
          AugmentBLU - MODX Partner

          BLUcart - MODX Revolution E-Commerce & Shopping Cart
          • 5274
          • 177 Posts
          Quote from: rossco at Apr 08, 2008, 08:07 AM

          ...do i put http://ip-of-server/localhost/ or is it a little more to it than that?

          The MySQL instance needs to be setup to accept network connections which is controlled near the top of the MySQL config file. If it’s configured to accept network connections then all you use is the ip-of-server or host_name.domain_name.tld instead of localhost. Drop the http:// or ftp:// or any other prefix that governs the connection protocol.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            You might also need to know the port number the server uses. Ports are machine addresses a server "listens" on for certain services; http is usually port 80 for example. The default port for MySQL is 3306 (or something like that). So if your server is using a different port, you would need database.domain.name:port
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 25551 ☆ A M B ☆
              • 1,231 Posts
              thank you! I managed to get in to my database just using the ip... superb. This opens up new ideas to me now. Thanks.
                Ross Sivills - MD AugmentBLU Edinburgh, Scotland UK
                AugmentBLU - MODX Partner

                BLUcart - MODX Revolution E-Commerce & Shopping Cart