We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1199
    • 3 Posts
    Hi Guys,

    I’m trying out Modx because i’ve heard good things about it.

    I have gotten as far as the database connection, which fails to connect to the database nomatter what combination of information i try.
    Connecting to mysql server:  
    Could not connect to the database server. Check the connection properties and try again.
    
    [2011-03-13 04:28:53] (ERROR in xPDO::connect @ /home/####/www/www/core/xpdo/xpdo.class.php : 331) SQLSTATE[HY000] [2005] Unknown MySQL server host 'localhost:/tmp/mysql5.sock' (3)
    
    [2011-03-13 04:28:53] (ERROR in xPDO::connect @ /home/####/www/www/core/xpdo/xpdo.class.php : 331) SQLSTATE[HY000] [2005] Unknown MySQL server host 'localhost:/tmp/mysql5.sock' (3) 


    I have heard that underscores in the database name will make this process fail. Unfortunately i cannot remove the underscores as my host automatically preceeds each database with the website name and underscore. I.e. "websiteName_databaseName"

    Any solution to this? or even a point in the right direction would be awesome.

    p.s.
    MySQL 5.1.54
    PHP 5.2.17

    Cheers
      • 22303 MODX Staff
      • 10,725 Posts
      Your problem is the "localhost:/tmp/mysql5.sock" being passed as the hostname. That is incorrect, or your PDO configuration is not configured for the proper MySQL socket file location.
        • 1199
        • 3 Posts
        This has been solved, with a little help from ICDSoft tech support.

        The solution has been noted here for public reference if anyone else is having the same issues.

        We tested this. MODx requires the PDO extension. With PDO, you have to specify the socket with "unix_socket". Please try these settings:
        
        host: localhost;unix_socket=/tmp/mysql5.sock
        login-name: ######
        password : ######
        database name: ######_modx
        table prefix: modx_
        
        With these settings the database test returned:
        
        Connecting to mysql server: Success!
        
        Let us know if you need any additional assistance or information.
        
        Best regards,
        Support
          • 1506
          • 1 Posts
          Just wanted to add: if you need to supply port number for MySQL connection, then database hostname string should look as follows:
          localhost;port=4215;unix_socket=/tmp/mysql.sock
            • 22303 MODX Staff
            • 10,725 Posts
            TBH, this socket should be properly configured for PDO so you don’t need to specify this in the connection string, but I’ll let you all deal with your providers on that issue.
              • 19980 ☆ A M B ☆
              • 275 Posts
              how do I reconfigure the XPDO if not just change the host value, please, Jason?
                modx and ecommerce pro