We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8384
    • 55 Posts
    Connection to host: failed!

    I have been trying for days to figure out what is wrong, and can’t. I’m moving my local install to the remote server. I am following everything that instructions tell me to do (probably missing something but can’t find it!)

    I’ve checked and rechecked the config file, I don’t know what else to do.

      • 3749
      • 24,544 Posts
      See if anything here helps:

      http://bobsguides.com/modx-installation-faq.html

      The most likely thing is that the host has added a prefix to the DB name and/or the db user’s name so you have those wrong in the config file.

      Another possibility is putting your MODx username/password in the config file rather than those of the DB user.

      Also, for most hosts, the DB server name is localhost, but occasionally it’s something else.

      PS: You did create a database and DB user with full rights on the remote host, right?
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 8384
        • 55 Posts
        Thanks for replying...

        the guys at my hosting provider have confirmed that the info given to connect to the db (hostname, username, pw) are all correct. The ip address for the client server is connected to the db for access. The info in the config file is for sure for the remote connection. and user has full rights.

        was just thinking... would anything in the .htaccess file be throwing it off?

        on the PS - the database is not on the remote server that the site sits on - the database sits on a different server. This shouldn’t matter though, should it? undecided
          • 3749
          • 24,544 Posts
          I don’t think MODx will use a database on another server without some serious modifications. I can’t think of any reason why you’d want to do this, especially on a fresh install.

          As for .htaccess, I usually rename it and turn off FURLs until I have a successful install, just to take it out of the equation.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 8384
            • 55 Posts
            Okay - sorry, I didn’t know the database had to be on the same server. I am also new to working with databases and didn’t know that it is better to always keep the database for that site on the same server as opposed to a different one.

            I have inherited the site I am working on for a re-design and chose modx to use to allow the client to make their own updates.

            soooo, then, I would have to get a hold of the info for the server that the site sits on to find out how to create a database on that server?

            I really appreciate your help and have referred to your site LOTS since I started working with modx.
              • 3749
              • 24,544 Posts
              Thanks for the kind words.

              Having the db on the same server will make things a lot faster (and simpler).

              If you log on to your host’s cPanel (or the equivalent) there should be a database section and a link to PhpMyAdmin. Creating a new database and adding a user with full rights should be fairly straightforward from there. Make sure to note the db name, user name (which might not be exactly what you entered), and password .

              There’s a little tutorial here http://www.modxhost.com/index.php?q=4.html, although it might not look exactly like what you see on your host.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting
                • 8384
                • 55 Posts
                I’ve shot an email to the previous webdude to find out who hosts the site and how to set the database on there. I have just been working with the ftp info to update the site.

                I swwwwwwwwwwear I used the right db name etc. in the config for the connection to the db to my server. I will let you know how it goes as soon as I get it done to see if this fixes it. I hope it does!

                thank you again for taking the time out. My head is hurting just a leeeeetle bit less now.

                smiley
                  • 3749
                  • 24,544 Posts
                  Uh oh . . . do you mean that there is a non-MODx database on the old non-MODx site that is used by the site? If so, things get more complicated. If the old site is in another Content Management System, such as Drupal or WordPress, it’s even worse because the content of the site is in that DB and its format wouldn’t be compatible with MODx.

                  Do you know exactly what is in contained in the old DB?

                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting
                    • 8384
                    • 55 Posts
                    No no - the old site was created with straight html and no CMS involvement, so it is really a whole new site,

                    However

                    : )

                    there is one page that uses a form and works with a separate database. But I am going to call that php page so that it remains outside of the modx structure and so can still use that other db. I think it will work!
                      • 3749
                      • 24,544 Posts
                      OK, you should be good to go then. If calling the other page doesn’t work, you can always import the DB data into the MODx db and convert the code that accesses it into a MODx snippet. You may want to do that down the line to speed things up, but you can cross that bridge much later.

                      So now, just create a new DB for MODx on the MODx site’s server and install MODx (I would say without the sample site, though some would disagree). Then see the section at my site on porting your site to MODx: http://bobsguides.com/porting-your-site-to-modx.html. smiley
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting