We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21940
    • 20 Posts
    I tried the host name as well and that didn’t work either.
    • Then one of the three is incorrect.
        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
        • 21940
        • 20 Posts
        All of the info I added is correct. Someone else has mentioned that this maybe a bug since there is a field missing which is "database name".
        • No. Once the connection to the database engine is successful, more form fields appear, including the database name, table prefix, and a drop-down select of available collations for the database. MySQL is not your database. When connecting to a database, you first connect to MySQL, then select a database. The raw PHP code would look like this:
          // we connect to example.com and port 3307
          $link = mysql_connect('example.com:3307', 'mysql_user', 'mysql_password');
          // make foo the current db
          $db_selected = mysql_select_db('foo', $link);
          

          Your problem is that with the information you have provided you are unable to connect to MySQL at all (the three parameters to the mysql_connect function).
            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
            • 21940
            • 20 Posts
            The information you enter here is generally your login information for your server. The wording on this is off, it should not ask for
            Database host:

            Database login name:

            Database password:

            it should read

            host ip:

            login name for host:

            password for host:

            I got it now, thanks for the help.
            • It means exactly what it says. The host is the name (or IP) of the server hosting MySQL. It may or may not be "localhost". The login and password must be for the database that the next step will select. For example, in a default MAMP localhost installation, the MySQL user is root, password root. If, however,I create a new user "modxuser" with a password of "xyz123" for my modx database, I must use this username and password when connecting to MySQL in order to access (or create) my modx database.

              Technically, the "host" username and password would be the server access login and password, and have nothing at all to do with MySQL or MODx. "host" = the server hosting the service. Apache, MySQL, sendmail or qmail, ssh and FTP are all services hosted on the server.
                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
              • I'm having the same issue with a ModX install on the web host iPowerWeb: when I initially enter the DB info on the "Database Information" page of the install everything works- the additional fields show up db name, connection method, db prefix, collation. When I click "Create or test selection of your database" it passes. After I click "Install" on the Optional Items screen I get the error: Creating connection to the database: Database connection failed!

                Why would it pass on the DB Info screen and fail on install? All the other check come out "OK" (except for register globals, but I know how to handle that). Any ideas? I've installed ModX on many other hosts many times before and have never seen this, the install is usually amazingly smooth and easy.

                Thanks in advance!
                  • 39801
                  • 1 Posts
                  Hi, just some info for everyone.. I had the same issue and managed to resove it.

                  The problem I was having is the same as tonkatrucker. Connection test passed on the Database Information page but failed when I got to the summary page.

                  After some debugging I found that the database username and password were being stored in $_SESSION and weren't being passed to the summary page. I found out that my hosting (ipage.com) required that you set the session path in php.ini or at the top of every script.

                  After adding the following line to my php.ini it worked.

                  session.save_path = "/path/to/document/root/cgi-bin/tmp"

                  Hope this is helpful to someone.
                    • 7327
                    • 195 Posts
                    Looks like the webhost NetFirms has this issue as well. I'm looking into Francis' quick fix to see if that helps. In the meantime, I can't mod the PHP.ini file directly, and have to rely on their customer support...
                    • Just to add my $.02 worth to this, I just had the same problem with a dedicated server, and had to get into the server to change the ownership of the directory specified in the session.save_path.

                      By default, the installation of the server had it owned by apache/apache, but we're running nginx so I changed it to the nginx user and group. Everything popped right into place after that.
                        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