• Hi all,
    This is the first time I am installing wordpress on server.It shows an error
    “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 xyzhostname. This could mean your host’s database server is down.”
    Database and username and password setup are done on 1and1 hosting in a different system.I have uploaded wordpress files to server and tried to install wordpress(/wp-admin/install.php) from my system with those details. But it shows the “error establishing a database connection” error.

    Should I do any database changes on my wamp system?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello abdukannur,
    You are getting this error because WordPress is unable to create a connection with your database. Kindly update your wp-config.php file with new details,

    /** The name of the database for WordPress */
    define(‘DB_NAME’, ‘database_name_here’);

    /** MySQL database username */
    define(‘DB_USER’, ‘username_here’);

    /** MySQL database password */
    define(‘DB_PASSWORD’, ‘password_here’);

    /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);

    1and1 doesn’t support localhost as MYSQL hostname so you have to update it as well to establish a database connection.

    Thread Starter abdukannur

    (@abdukannur)

    Thanks for your reply.

    I have tried that but it shows the same error.

    I also tried to check my database connection using the following code by creating a file test.php (domain.com/test.php):

    <?php
    $testConnection = mysql_connect(‘localhost’, ‘root’, ‘password’);
    if (!$testConnection) {
    die(‘Error: ‘ . mysql_error());
    }
    echo ‘Database connection working!’;
    mysql_close($testConnection);
    ?>

    It outputs the error :
    “Error: Access denied for user ‘xxxxxxxx’@’xx.1xx.xxx.xx’ (using password: YES)

    What does that error mean?
    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘should I import database from server to local.database’ is closed to new replies.