We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18348
    • 6 Posts
    Been playing around with the previous MODx, but since MODx 2.0.0-pl’s release I have felt it better to start on the latest codebase. However for the first time in many years I have been unable to get past the most basic stage of an install process, connecting to the MySQL5 database tongue . Yeah laugh it up.

    Now I am familiar with 1and1 being a bit annoying in this department because with MySQL5 the localhost and socket are usually written as one "localhost:/tmp/mysql5.sock". Also with 1and1 and PHP5 enabled (note: I have a managed dedicated server) you cannot use PHP flags in .htaccess otherwise it will throw up random error 500’s. Fair enough, I usually just use a php.ini instead.

    Anyway, started the process and got to the database connection bit. Entered the details and no dice (couldn’t find the server). This did not surprise me, seen it before as the localhost address with a socket tends to confuse some scripts, so I broke out my php.ini and added this "mysql.default_socket = /tmp/mysql.sock".

    Now the database server is found but I’m getting "[1045] Access denied for user: ’dbo**********@localhost’ (Using password: YES)". I figured my password, dbname or username data must be wrong so tried pasting it and re-entering manually multiple times. The database details still work fine in my other applications (I am using it for the Modx 1 series, drupal tests and several other scripts). I then tried 4 other databases but all had the same problem.

    The error suggests a basic typo mistake but nothing I try works, the information is going in correctly to the fields so this should be fine. I don’t use any special characters either so there should be no problems with unusual web-based character recognition/encoding.

    Anyone have any ideas? What would really be good is if MODx 2.0.0-pl allowed people to make a manual config file like most scripts. That way I could just pre-enter and see what was going in, even the password.
      • 18348
      • 6 Posts
      Nobody have any idea sad .
        • 18348
        • 6 Posts
        Tried everything I can possibly think of now (Note I have MySQL5.0.67 and PHP 5.2.14).

        Still getting this:

        [2010-08-12 17:37:25] (ERROR in xPDO::connect @ /*****/modx2/core/xpdo/xpdo.class.php : 305) SQLSTATE[00000] [1045] Access denied for user: ’***********@localhost’ (Using password: YES)

        The details are all correct. Interestingly I decided to make two test scripts, one as described by MODx and a standard MySQL test script. The MODx one essentially returned the same error as above, but I noticed some odd behaviour with the test script.

        Firstly this worked fine:

        <?php
        mysql_connect("localhost:/tmp/mysql5.sock", "*******", "*******") or die(mysql_error());
        echo "Connected to MySQL
        ";
        ?>

        Now obviously if I take out the socket ":/tmp/mysql5.sock" from that code then you get this:

        Warning: mysql_connect() [function.mysql-connect]: Access denied for user: ’******@localhost’ (Using password: YES) in /****************/modx2/ptest1.php on line 2
        Access denied for user: ’*******@localhost’ (Using password: YES)


        So I played around with adding this to php.ini again:

        mysql.default_socket=/tmp/mysql.sock
        mysqli.default_socket=/tmp/mysql.sock
        pdo_mysql.default_socket=/tmp/mysql.sock

        I also tried using and removing this in the .htaccess, sometimes alongside the php.ini addition and others without it:

        php_value mysql.default_socket "/tmp/mysql5.sock"

        No change, the test scripted continued to say "Access denied for user", suggesting that it is trying to connect with the "localhost" (i.e. MySQL4 databases) but not my MySQL5 databases at "localhost:/tmp/mysql5.sock". In desparation I also tried things like "/tmp/mysqld.sock" and "/var/run/mysqld/mysqld.sock" with no luck.

        Every other system I have works and connects to the database fine, some need tweaking for the socket details, but they always work. For some reason MODx 2.0 has problems with basic connectivity as soon as I add "/tmp/mysql5.sock" into the mix.
          • 18348
          • 6 Posts
          Not even one reply :’( .
            • 17499 ☆ A M B ☆
            • 872 Posts
            Can you try to install Evo on the same server?
              • 1343 ☆ A M B ☆
              • 2,213 Posts
              Quote from: lossendae at Aug 23, 2010, 02:14 PM

              Can you try to install Evo on the same server?

              He notes being able to use Evolution (1 Series)

              The database details still work fine in my other applications (I am using it for the Modx 1 series, drupal tests and several other scripts). I then tried 4 other databases but all had the same problem.
                Patrick | Server Wrangler
                About Me: Website | Tweets |  MODX Hosting
                • 17698
                • 19 Posts
                I ran into the exact same problem today. After beat my head against the wall on this problem for a few hours. I finally got it to work after understanding how to make a PDO connection to MYSQL, and then armed with that knowledge came up with a workaround.

                On the install for the database server enter:
                localhost;unix_socket=/tmp/mysql5.sock

                At least that’s what it is for 1and1 Managed Servers. I would assume that adding the socket in a similar fashion would work for others as well.

                Wish there was another form field on the database install for Socket. I’m not sure I have the time to figure out where this would actually go in the code. Certainly, not in the near future, but I suppose this workaround will do for now.
                  Erik Lutenegger
                  Founder | Tenacity
                  • 18348
                  • 6 Posts
                  That worked! Excellent, I want to have your babies.. laugh .

                  Now to figure out how to turn the blank front page you start off with into something with content. Is the default page after install supposed to be blank? I was expecting at least a standard template or something. Anyway I’ll read the docs, pootle around the admincp and figure it out I suppose.
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Revo doesn’t come with any resources or elements.
                      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
                      • 17698
                      • 19 Posts
                      The Home page has no content, and the BaseTemplate is a near blank slate. This is why you have a white page.
                        Erik Lutenegger
                        Founder | Tenacity