• skmanu

    (@skmanu)


    Warning: mysqli_real_connect(): (HY000/2002): Connection refused in /home/341/148341/public_html/wp-includes/wp-db.php on line 1529

    Error establishing a database connection
    This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at 127.0.0.1:3306. This could mean your host’s database server is down.

    Are you sure you have the correct username and password?
    Are you sure that you have typed the correct hostname?
    Are you sure that the database server is running?
    If you’re unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

    • This topic was modified 8 years ago by skmanu.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Adarsh Verma

    (@shobhit2412)

    Hi @skmanu,
    You can just access the “wp-config.php” file at the wordpress root and verify the DB details mentioned there. Either of the details might be wrong which is not allowing your site to connect to the database.
    Thanks.

    Thread Starter skmanu

    (@skmanu)

    Hi @shobhit,
    I’m already verified my db name,user and password..everything seems fine.But still getting the same error

    Adarsh Verma

    (@shobhit2412)

    Hi @skmanu,
    Please add the following line in your wp-config.php file:

    define( 'WP_ALLOW_REPAIR', true );

    and then goto – https://www.yourwebsite.com/wp-admin/maint/repair.php
    and click on “Repair Database”.

    and if this doesn’t help you, then the hostdb server must be down. You need to contact to your host povider regarding the same.
    Thanks.

    Thread Starter skmanu

    (@skmanu)

    Hi @shobhit,
    Included the above code to wp-config.php.
    But still getting the same error.

    Clayton James

    (@claytonjames)

    Try removing the port number from the database host line in your wp-config.php file and see if that makes any difference.

    Try for example: define( 'DB_HOST', '127.0.0.1' ); – or – define( 'DB_HOST', 'locahost' );

    Thread Starter skmanu

    (@skmanu)

    Yes I tried with both..But same error

    Clayton James

    (@claytonjames)

    Contact your hosts support group and have them assist in confirming that your database info and DB_HOST address is correct, and that your database user is in fact able to connect to your database.

    Thread Starter skmanu

    (@skmanu)

    I hosted my website in 000webhost..How do i contact them?

    Clayton James

    (@claytonjames)

    What is MySQL hostname?

    You have go to our members’ area, enter the control panel and click on the ‘MySQL’ icon. Your MySQL hostname will be listed there.

    Important! Never use ‘localhost’ as your MySQL hostname here or you will get access denied errors!

    Source: https://www.000webhost.com/website-faq/what-is-mysql-hostname-24

    Thread Starter skmanu

    (@skmanu)

    Hey…yes
    I got the solution when I changed my php version to 5.6 from 7.0.
    But I don’t know why does it matters:)
    Thank you all

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Warning: mysqli_real_connect(): (HY000/2002)’ is closed to new replies.