• After creating the database and username with password in Cpanel I receive the following PHP connection string:
    $dbh=mysql_connect (“localhost”, “netbased_nblog”, “<PASSWORD HERE>”) or die (‘I cannot connect to the database because: ‘ . mysql_error());
    mysql_select_db (“netbased_nblog”);
    Using only ‘localhost’ resulted in a connection error when running wp-admin/install.php. Now it gets started but I receive this error”
    Parse error: parse error in /home/netbased/public_html/nb_weblog/wp-config.php on line 9
    Fatal error: Call to a member function on a non-object in /home/netbased/public_html/nb_weblog/wp-admin/install.php on line 52
    Line 9 looks like: $loginsql = DB_USER; (if I counted the lines correctly).
    I realize I’m that 1% that ‘localhost’ doesn’t work for.
    Any suggestions of what to attempt . . . ?
    Thanks,
    Don

Viewing 8 replies - 1 through 8 (of 8 total)
  • Check around your cpanel, and look for any mysql or odbc information – that should give an example string.

    Thread Starter DonG

    (@dong)

    Thanks podz for replying.
    Cpanels gives two examples after the database name, username and password are created. For Perl the example is:
    $dbh = DBI->connect(“DBI:mysql:netbased_nblog:localhost”,”netbased_nblog”,”<PASSWORD HERE>”);
    For PHP the example is:
    $dbh=mysql_connect (“localhost”, “netbased_nblog”, “<PASSWORD HERE>”) or die (‘I cannot connect to the database because: ‘ . mysql_error()); mysql_select_db (“netbased_nblog”);
    As you can see above, I inserted the PHP connection string between the ‘ ‘ replacing localhost. Does this give you any insights?
    Thanks again, Don

    Hmm… just realised…..how are you doing this ?
    What you have seen so far is not a WP error message, and you should not be seeing any ‘raw’ code like you mention in your first post.

    Use localhost. That should work fine.

    Thread Starter DonG

    (@dong)

    Some days I think I just hold my mouth wrong. I had started with ‘localhost’ and was recieving an error that many others have reported. Changed the string as I mentioned above, got a different error. I attempted ‘localhost’ one more time and bingo.
    Sometimes . . . it just escapes me. Sorry for the bother. But most importantly, thanks for the support!!
    Don

    geez, i have a huge problem, i tried ti edit something in the template for my website, down in the bottom where the default also says ‘powered by wordpress’ … i think i deleted something very essential, it was after the https://www.wordpres.org and now my website is offline and i also closed the window, so no way of retrieving the window in which all of it happened…
    tried to get into the website using my bbedit ftp program but don’t know where to look, because i never go there ..
    anyone????!!!!

    ps, i found the template in my ftp files, and i need the right code for just 1 line ..
    the part that says “Powered by WordPress” …. what is the exact code for that? i’ll try to get the default template page somewhere but if anyone can help me with just that one line it would be great .. it now looks like this ..:
    <p class=”credit”><!–<?php echo $wpdb->num_queries; ?> queries. <?php timer_stop(1); ?> seconds. –> <cite><?php echo sprintf(__(“
    copyright ???? 2005 Mizar5. All rights reserved. Powered by ************>WordPress“),
    __(“Powered by WordPress, state-of-the-art semantic personal publishing platform”)); ?></cite>
    </body>

    and where the ****** something got deleted …

    already solved the problem!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘DB_HOST connection string Error’ is closed to new replies.