We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16899
    • 284 Posts
    Quote from: sottwell at Aug 16, 2013, 04:53 AM
    With CPanel and most other hosting control panels, you need to create a new database, and create a user for the database. You need to give that user appropriate permissions, including create permissions so it can create the tables.

    Usually you then need to go into the supplied phpMyAdmin, use the Operations tool and change the default charset and collation to utf8.

    The database name and the username quite often have default prefixes prepended to the names you specify; for example I might end up with something like sottwell_database. This isn't always obvious at first glance.

    Totally agree!! If you are not getting database connection, it´s because something goes wrong on database connection. On Phpmyadmin:

    1 - Check database name and user password (normally Cpanel and other panels adds a prefix to it, so have this in consideration!!!)
    2 - Check User permissions (Grants all)

    Then insert all the information on the modx setup! This should work fine
      • 19872
      • 1,078 Posts
      It's been my experience with char set issues that when I've created the database using the hosting companies control panel, the database gets set up using a default setting. Often, with myHosting.com, the default for whatever reason has been swedish. My solution is to get the database established, use phpAdmin and change the char set to whatever you need it to be, BEFORE installing MODx. You can certainly modify the char set of you mySQL database after a MODx install, however, it's a super tedious process.

      I always utf8 unicode. utf8_unicode_ci

      In terms of MODx then not being able to set up the database and get past the database portion of the setup during the install of MODx? In my cases, this has been a user name issue. If you're trying to host at goDaddy, they have a misleading—at least it was to me— naming system where you give your database a name and a "friendly" name. The "friendly name" is only for the purposes of the goDaddy control panel. When I tried to use that "friendly" name as the name of the database during the MODx install, the result was the error about MODx not being able to create the database.....

        • 28042 ☆ A M B ☆
        • 24,524 Posts
        The default charset and collation for MySQL is latin1, latin1_swedish_ci. This can be changed in the MySQL configuration file (my.conf) but nobody ever seems to do that, even though utf8 would be a much more sensible default.

        http://dev.mysql.com/doc/refman/5.0/en/charset-applications.html
          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
          • 19872
          • 1,078 Posts
          That's exactly what I discovered. In my scenario I find it easiest now to take care of the char set and collation FIRST. Then install MODx.

          In my first encounter with this situation, I deleted all of the MODx installed files and started over. In my case, there are always a couple of folders and files installed by MODx that ONLY the hosting tech support is able to delete.
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            That is because PHP is being run as an Apache module, so the .php files (in the case of installing MODx, the /setup/index.php file) are run as the Apache user. Any files and directories created by those php scripts will be owned by the Apache user, so your FTP user can't delete them.

            You should be able to delete them using your hosting control panel's file manager.
              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
              • 19872
              • 1,078 Posts


              Quote from: sottwell at Aug 16, 2013, 08:29 AM
              That is because PHP is being run as an Apache module, so the .php files (in the case of installing MODx, the /setup/index.php file) are run as the Apache user. Any files and directories created by those php scripts will be owned by the Apache user, so your FTP user can't delete them.

              You should be able to delete them using your hosting control panel's file manager.

              In the case with myHostng.com, these picky files could not be deleted even through the hosting control panel, regardless of what I tried or what permissions I tried to give them. The hosting tech support had to delete them for me.
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Ugly. That's why I have for years made sure to only host with providers that use PHP as a CGI/FastCGI processor, or at least some form of "suexec" where the user of a script is switched to the user of the script file's owner (in our case, it would be your FTP user). I actually found that A2 and SkyToaster are at least no more expensive than the "usual" cheap hosting plans (like FatCow or GoDaddy), and certainly more reliable.
                  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