Support » Installing WordPress » wp-config.php

  • Resolved


    I have been trying to get wordpress to work on my system with no luck.
    I am using a linux box (fedora 12) and have all the necessaary s/w already installed and running, like apache/mysql/php. After making the wp-config.php file, and filling in the values of database/username/password, it keeps on giving me the same 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 localhost. 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.

    Just to be sure, i installed chyrp with the same parameters and it worked and that too within 5 minutes. I have even installed phpmyadmin just to be sure that my database is set up properly. I have droped and created my database countless times, tried with different usernames with no luck. Please help.

    I think i should move to movable type.:@ :@ :@ :@

Viewing 9 replies - 1 through 9 (of 9 total)
  • I have installed wp on my server and created a site cna training I just had to create a database and then opened the index page in browser then configured it by supplying the info asked there, that’s it wp was ready.

    Still gives me the same error. The thing that really p**** me off is that, with the same parameters i can install and use chyrp (blogging engine)…mysqld/apache services are running, but the stupid wp doesnt works. I spent almost whole day yesterday trying to figure this out.

    If chyrp can work with the same paramenters, why cant wp.??

    Ok, just to be sure i used the following script to check my database connection….and it worked perfectly.

    **** replaced with username and password.

    // hostname or IP of server (for local testing, localhost should work)
    // replace loscalhost if other host for db !! on dedicated server environment
    // it usually is localhost for most people - also for your local machine
    // adapt the following to your needs below in below php script
    // your-db-user = real username for a particular mysql db
    // yourpassword = real password for a particular mysql db
    // your_db_name = real db-name for a particular mysql db
    // expand same to as many mysql db as needed - changing the number after all names as below !!
    // script tested with PHP5 on SuSE/Novel Linux 10.1 - for free use - OS - have fun
    // security alert - it is best you chmod 000 this file after use - just in case !
    // and before use chmod again back to 644
    // RENAME this file with file extension .php before use !!!
    // username and password to log onto db server
    // name of database
        $link = mysql_connect("$dbServer1", "$dbUser1", "$dbPass1") or die("Could not connect post");
        print "Connected successfully to your_db_name1<br>";
        print $dbName1;
        print $dbUser1;
        print $dbPass1;
        mysql_select_db("$dbName1") or die("Could not select database your_db_name1");
        print "Database your_db_name1 selected successfully<br><br><br>";
    // close connection
    // hostname or ip of server (for local testing, localhost should work)
    // username and password to log onto db server
    // name of database
        $link = mysql_connect("$dbServer2", "$dbUser2", "$dbPass2") or die("Could not connect your_db_name2");
        print "Connected successfully to your_db_name2<br>";
        mysql_select_db("$dbName2") or die("Could not select database your_db_name2");
        print "Database your_db_name2 selected successfully<br><br><br>";
    // close connection
    // hostname or ip of server (for local testing, localhost should work)
    // username and password to log onto db server
    // name of database
        $link = mysql_connect("$dbServer3", "$dbUser3", "$dbPass3") or die("Could not connect your_db_name3");
        print "Connected successfully to gallery<br>";
        mysql_select_db("$dbName3") or die("Could not select database your_db_name3");
        print "Database your_db_name3 selected successfully<br><br><br>";
    // close connection

    Am starting to hate wp. grrrrrr.

    It is clearly an issue with the wp-config settings if you can get your db working from the above script. Have you ensured that you have the correct table prefix?

    No its not the wp-config settings or any other setting….apparently the name of the wordpress folder cannot be set to ‘wordpress’!!!!!! I mean seriously, cmon wordpress guys….what the *****. The moment i changed the wordpress folder name, it started working, and when i change it back to wordpress….same database connection error. I dont know if anyone noticed this before, but i think this is one big bug that should be removed.

    Took me almost two days to figure this one out.

    I posted on the other thread you have posted to regarding the wordpress folder. I have installed a clean wordpress installation into a wordpress folder and with a wordpress DB without any problems. It was on my local test server but I can login, run the pages etc. I haven’t fully tested it with uploads etc. but I have gone beyond the point of the problem you had.

    I am sure that your problem was genuine, but I don’t think it is the wordpress folder is the root issue.

    Thanks for giving it a shot. I did a fresh install of my OS, not because of wordpress…it was long due….anyway, will try it again myself.

    Second, did you name the folder as ‘wordpress’ or did you gave it the default name ie. ‘wordpress en-(version)’?? For me, and that also twice, naming the folder as wordpress gave an error. Will try again myself, and post here.

    Here is a brief copy of the file list:-

    Directory Listing of /wordpress/

    wp-admin/ 04-02-2011 11:05:57
    wp-content/ 04-02-2011 11:05:57
    wp-includes/ 04-02-2011 11:05:55

    For many reasons I have never called a directory wordpress or used a wordpress database name – mainly security and better looking URLs. This was built on my localhost dev server the same as you. There may be some issues on web servers when, for example, an auto installer could foul something up, which is why I always use different names and manual FTP’s.

    grrr it works now ….. i wonder what went wrong last time.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘wp-config.php’ is closed to new replies.