We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12531
    • 15 Posts
    Dear community,

    I’ve tried for several hours to fix this one:

    First time install - I created database admin and dartabse as instructed. I get succes from:

    Connection to host: passed - collations now available

    but, when checking database I get:

    Checking database: failed - could not create database

    I know it exists, and I think the name is correct and the permissions are correct, but I can’t get past this screen.

    Any help appreciated. I’ve attched some info about the servver version etc.

    Many thanks.
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Check the file install/connection.databasetest.php Line 19 should read:
       if (!@ mysql_select_db(str_replace("`", "", $database_name), $conn)) {

      Note the position of the $conn after the $database_name), and not inside the ). This appears to have been in a recent SVN version, but has been fixed as of revision 3825.
      http://svn.modxcms.com/jira/browse/MODX-183
        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
        • 12531
        • 15 Posts
        Thanks for the reeponse Susan. I have changed the code adn applied, but I still get the same error. Are there any more I should check?

        Kind Regards,

        hypnoman
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          No, that was the only problem I’ve seen, and it was the first installation failure I’ve ever had in three years of heavy MODx use.

            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
            • 7231
            • 4,205 Posts
            You may not have permission to create new databases with the user (for example cPanel will not allow this). In this case you will need to create the database first (and possibly assign a user to the database) from the hosting control panel and then continue with the install.
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don't know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 12531
              • 15 Posts
              Thanks for the advice. I’ve set up the db manually and it passes stage 1 of the verify connection. It’s just stage 2 where it tries to create the db (which I’ve already done)

              Thanks

                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Where did you get your MODx archive from?
                  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
                  • 12531
                  • 15 Posts
                  I downloaded it from the mods repository today. I’ll do the whole process again to make sure. I’ll even load it onto another virgin site, which is in the same ISP though. I’ll post the results here soon.
                    • 4310
                    • 2,310 Posts
                    Does the Database name have an underscore or hyphen in it by any chance?
                      • 12531
                      • 15 Posts
                      aha thta may be it. The database creates automatically prefixes so the database for modx for my site is shelleys_modx and I have no way of changing this. Is thisnthe issue?