We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28626
    • 87 Posts
    Connecting to mysql server: Could not connect to the database server. Check the connection properties and try again.

    I’m having the same problem, it worked fine with the revo beta version but fails to install on the rc1

    Mysql runs on localhost port 3306

    Linux ubuntu 2.6.32-16-generic #25-Ubuntu SMP Tue Mar 9 16:33:12 UTC 2010 x86_64

    mysqlnd 5.0.5-dev - 081106 - $Revision: 289630 $
    PDO drivers mysql, pgsql, sqlite, sqlite2
    pdo_mysql.default_socket /opt/lampp/var/mysql/mysql.sock

    PHP Version 5.3.1

    php.ini /opt/lampp/etc/php.ini
    DOCUMENT_ROOT /opt/lampp/htdocs

    Browser used: User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Chrome/5.0.360.0 Safari/533.3


      • 26401
      • 247 Posts
      Were you able to use the remote connection?

      I got it to install, but I’m still having issues.
        • 28215
        • 4,149 Posts
        Quote from: stofke72 at Mar 24, 2010, 10:51 AM

        I have the same problem, it worked fine with the revo beta version but fails to install on the rc1
        Mysql runs on localhost port 3306
        Linux ubuntu 2.6.32-16-generic #25-Ubuntu SMP Tue Mar 9 16:33:12 UTC 2010 x86_64
        mysqlnd 5.0.5-dev - 081106 - $Revision: 289630 $
        PDO drivers mysql, pgsql, sqlite, sqlite2
        pdo_mysql.default_socket /opt/lampp/var/mysql/mysql.sock
        PHP Version 5.3.1
        php.ini /opt/lampp/etc/php.ini
        DOCUMENT_ROOT /opt/lampp/htdocs
        Browser used: User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/533.3 (KHTML, like Gecko) Chrome/5.0.360.0 Safari/533.3

        When you said "fails", what do you mean? Please provide specific details on what "fails", what error messages there were, if there’s any errors in core/cache/logs/install-[timestamp].log, etc.

          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 28626
          • 87 Posts
          Connecting to mysql server: Could not connect to the database server. Check the connection properties and try again.

          No logs in core > cache yet

          I can connect to phpmyadmin and the revo beta connects to the database but the new rc can’t find the database.
            • 28626
            • 87 Posts
            Quote from: daspoda at Mar 24, 2010, 11:06 AM

            Were you able to use the remote connection?

            I got it to install, but I’m still having issues.

            I didn’t quite understood what to do exactly

            Meanwhile I tried all suggestions I could find on the forum, like symlink mysql.sock to /tmp/mysql.sock , tried to login with 127.0.0.1 instead of localhost but nothing seems to work
              • 28215
              • 4,149 Posts
              Can you run this script (replacing the db host/name/user/pass) and tell us the result:

              <?php
              $dsn = 'mysql:dbname=testdb;host=localhost';
              $user = 'dbuser';
              $password = 'dbpass';
              
              try {
                  $dbh = new PDO($dsn, $user, $password);
              } catch (PDOException $e) {
                  echo 'Connection failed: ' . $e->getMessage();
                  die();
              }
              echo 'Success!';
              
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 28626
                • 87 Posts
                Quote from: splittingred at Mar 24, 2010, 11:59 AM

                Can you run this script (replacing the db host/name/user/pass) and tell us the result:

                <?php
                $dsn = 'mysql:dbname=testdb;host=localhost';
                $user = 'dbuser';
                $password = 'dbpass';
                
                try {
                    $dbh = new PDO($dsn, $user, $password);
                } catch (PDOException $e) {
                    echo 'Connection failed: ' . $e->getMessage();
                    die();
                }
                echo 'Success!';
                


                It doesn’t throw any error and displays ’Success!’

                I tried to do the setup again this time with Firefox 3.6 but it won’t go past that same error.
                  • 28215
                  • 4,149 Posts
                  Try without the DB:

                  $dsn = 'mysql:host=localhost';
                  $user = 'dbuser';
                  $password = 'dbpass';
                  
                  try {
                      $dbh = new PDO($dsn, $user, $password);
                  } catch (PDOException $e) {
                      echo 'Connection failed: ' . $e->getMessage();
                      die();
                  }
                  echo 'Success!';
                  
                    shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                    • 28626
                    • 87 Posts
                    same result Success!

                    And it’s also not some problem with my php install ignoring the try/catch part because if I enter on purpose a wrong database or hostname it does throw an error so the script does work as it is supposed to be.
                      • 28215
                      • 4,149 Posts
                      In setup, do you get this error on the first part of the DB setup page, or the 2nd?

                      IOW, before or after choosing the collation?
                        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com