Discover Centmin Mod today
Register Now

Wordpress MySQL Connection Error / CentMin Option 22 / WordPress Install

Discussion in 'Blogs & CMS usage' started by connectivityengineer, Mar 13, 2016.

  1. connectivityengineer

    connectivityengineer New Member

    15
    5
    3
    Feb 27, 2016
    Ratings:
    +10
    Local Time:
    6:44 AM
    1.9.12
    10
    Installing WordPress via Option 22 on the menu

    Install completed however - the site errors with a message stating it cannot connect to the database.
    We are however able to connect to the database using credentials within the wp-config file.

    We thought it strange - and so we then went and created a brand new vps
    installed the latest centminmod - and tried again - same thing

    Any thoughts?
     
  2. eva2000

    eva2000 Administrator Staff Member

    41,995
    9,471
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,574
    Local Time:
    9:44 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    what's the listed mysql host, username, password and database name listed in wp-config.php ? wrap in CODE tags :)

    what's exact error message you get ? where do you get it ? within browser ?

    output for these commands in CODE tags too
    Code (Text):
    php -v
    php -m
     
  3. connectivityengineer

    connectivityengineer New Member

    15
    5
    3
    Feb 27, 2016
    Ratings:
    +10
    Local Time:
    6:44 AM
    1.9.12
    10
    I have tried a few php version -
    In short - the installer itself should have built the config file - (which it did btw)

    Error shows in browser

    Code:
    PHP Modules
    bcmath
    bz2
    calendar
    Core
    ctype
    curl
    date
    dom
    enchant
    ereg
    exif
    filter
    ftp
    gd
    geoip
    gettext
    gmp
    hash
    iconv
    igbinary
    imagick
    imap
    intl
    json
    libxml
    mbstring
    mcrypt
    memcache
    memcached
    mhash
    mongo
    mysql
    mysqli
    mysqlnd
    openssl
    pcntl
    pcre
    PDO
    pdo_mysql
    pdo_sqlite
    Phar
    posix
    pspell
    readline
    redis
    Reflection
    session
    shmop
    SimpleXML
    snmp
    soap
    sockets
    SPL
    sqlite3
    standard
    sysvmsg
    sysvsem
    sysvshm
    tidy
    tokenizer
    xml
    xmlreader
    xmlrpc
    xmlwriter
    xsl
    Zend OPcache
    zip
    zlib
    
    [Zend Modules]
    Zend OPcache
    
    php -v
    PHP 5.4.45 (cli) (built: Mar 13 2016 10:18:26)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.5, Copyright (c) 1999-2015, by Zend Technologies



    happens with all versions of php even 5.x - 7.x

    gimme a bit to pass a little more info
     
  4. connectivityengineer

    connectivityengineer New Member

    15
    5
    3
    Feb 27, 2016
    Ratings:
    +10
    Local Time:
    6:44 AM
    1.9.12
    10
    sorry on the road - so not the best connection

    The Same user/pass in the wp-config DOES NOT WORK via php but does from command line

    wp-config file works on another host just fine as well

    :-(
    PHP:
    // ** MySQL settings ** //
    /** The name of the database for WordPress */
    define('DB_NAME''wp1726db_4389');

    /** MySQL database username */
    define('DB_USER''wpdb4389u20976');

    /** MySQL database password */
    define('DB_PASSWORD''wpdbyxj3WxHPjqyop31387');

    /** MySQL hostname */
    define('DB_HOST''localhost');

    /** Database Charset to use in creating database tables. */
    define('DB_CHARSET''utf8');
     
  5. eva2000

    eva2000 Administrator Staff Member

    41,995
    9,471
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,574
    Local Time:
    9:44 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    strange indeed.. what's the exact error message reported by wordpress on frontend ?
     
  6. connectivityengineer

    connectivityengineer New Member

    15
    5
    3
    Feb 27, 2016
    Ratings:
    +10
    Local Time:
    6:44 AM
    1.9.12
    10
     
  7. eva2000

    eva2000 Administrator Staff Member

    41,995
    9,471
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,574
    Local Time:
    9:44 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Last edited: Mar 17, 2016
  8. connectivityengineer

    connectivityengineer New Member

    15
    5
    3
    Feb 27, 2016
    Ratings:
    +10
    Local Time:
    6:44 AM
    1.9.12
    10
    YES -

    In short - a very simple php file that does a test connection to the database does not work
    still debugging however
     
  9. johnnyc

    johnnyc Member

    33
    2
    8
    Mar 23, 2015
    Ratings:
    +2
    Local Time:
    5:44 AM
    did you ever figure this out?

    I'm having this exact issue right now.
     
  10. ardan7779

    ardan7779 New Member

    4
    0
    1
    Nov 3, 2019
    Ratings:
    +0
    Local Time:
    6:44 PM
    Yes. Any body have the sollution..?
    I get the same issue.

    I triple check that's my credential of my wp-config.php is true at all. But still
    "Error establishing a database connection"
     
  11. eva2000

    eva2000 Administrator Staff Member

    41,995
    9,471
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,574
    Local Time:
    9:44 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    can you provide some more info

    Please fill in any relevant information that applies to you:
    • CentOS Version: i.e. CentOS 6 32bit or 64bit / CentOS 7 64bit ?
    • Centmin Mod Version Installed: i.e. 123.08stable or 123.09beta01
    • Nginx Version Installed: i.e. 1.15.3
    • PHP Version Installed: i.e. 5.6.37, 7.0.31, 7.1.21, 7.2.9
    • MariaDB MySQL Version Installed: i.e. 10.0.x or 10.1.xx or 10.2.xx
    • When was last time updated Centmin Mod code base ? : i.e. run centmin.sh menu option 23 submenu option 2 or cmupdate command
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:
      Code (Text):
      cat /etc/centminmod/custom_config.inc
      

      Post output in CODE tags.
    • How was Wordpress installed ? via centmin.sh menu option 22 wordpress installer, via centmin.sh menu option 2 with manual Wordpress install ?
    • How did you create mysql username/password if you did do manual Wordpress install ?
     
  12. ardan7779

    ardan7779 New Member

    4
    0
    1
    Nov 3, 2019
    Ratings:
    +0
    Local Time:
    6:44 PM
    Hellow. I use centmint on my Centos7 86_64. Install centminmod with command:

    curl -O https://centminmod.com/betainstaller73.sh && chmod 0700 betainstaller73.sh && bash betainstaller73.sh

    I Install from auto install in centminmod menu, means the database user n password are auto generated.
     
  13. eva2000

    eva2000 Administrator Staff Member

    41,995
    9,471
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,574
    Local Time:
    9:44 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Ok then that should of worked. Might need to troubleshoot.

    Troubleshooting Centmin Mod Menu Option 22 Wordpress Install Run



    To troubleshoot centmin.sh menu option 22 wordpress installation, you need to check the centmin.sh menu option 22 log located in /root/centminlogs at /root/centminlogs/centminmod_*_wordpress_addvhost.log based log where * is the centminmod version and date timestamp. Edit and mask any actual ftp username/password or wordpress usernames and logins before posting the log contents to Pastebin.com or Gists to share a sanitised version of the contents of the log.

    Example list /root/centminlogs files in date ascending order and grep for wordpress_addvhost.log
    Code (Text):
    ls -lahrt /root/centminlogs | grep wordpress_addvhost.log
    

    example output returns log at /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log
    Code (Text):
    ls -lahrt /root/centminlogs | grep wordpress_addvhost.log
    -rw-r--r--  1 root root 2.2M Oct 11 01:40 /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log
    

    in SSH use cat to ouput contents of /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log. Clear your SSH client window/buffer so only output is the contents of the file
    Code (Text):
    cat /root/centminlogs/centminmod_1.2.3-eva2000.09.001_111016-112321_wordpress_addvhost.log
    

    Then copy and paste into Pastebin.com or Gists entry. If your SSH window scroll buffer isn't that large to get the whole contents of the install log, you can download file manually and copy and paste contents. But makes sure it's sanitised version of the contents without revealing sensitive info. For example you can replace domain name of the wordpress site with generic dummy entry = domain.com if you want and mask site/server IP revealed in the log with generic dummy entry = 111.222.333.444.
     
  14. ardan7779

    ardan7779 New Member

    4
    0
    1
    Nov 3, 2019
    Ratings:
    +0
    Local Time:
    6:44 PM
    Okay thanks for the answer.