• Im getting the standard unable to connect message when trying to install.

    “Error establishing a database connection”

    URL is http://www.victorialynn.co.uk/wordpress/wp-admin/install.php

    I have checked all the mysql settings in the config file, and didnt have any problems connecting to the mysql server using the mysql administator program. I’ve even tried connecting to a mysql server which i know works. All give me the same message.

    Here is my config file.

    define(‘DB_NAME’, ‘wordpress’); // The name of the database
    define(‘DB_USER’, ‘HIDDEN’); // Your MySQL username
    define(‘DB_PASSWORD’, ‘HIDDEN’); // …and password
    define(‘DB_HOST’, ‘sip1.sippal.com’); // 99% chance you won’t need to change this value

    Ive tried putting the port number in too, but no luck.

    Any ideas? Could it be a PHP problem? Other PHP scripts running on the server can access mysql servers without any problems.

    Thanks for your help
    Dan Journo
    [sig moderated]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Was the user added to the database?
    Are you 120% sure no typos in the config file?

    Thread Starter kesher

    (@kesher)

    Yes, i even tried the root user so that there were no permission issues.

    Also, forgot to mention its IIS6, if that matters.

    Oh, it always matters. Sometimes WP has issues with IIS servers. But I have no idea how those servers work – I never accept a WP job until the client moves to a “normal” (=*nix) server 🙂

    You may want to try a search around here for IIS and/or Win server install…

    Try creating a php file just to test the connection:

    <?php
    $conn = mysql_connect('sip1.sippal.com','user','password');
    // should echo 'Resource id #[some number]'
    echo $conn;
    // now see what databases are available
    $dbs = mysql_list_dbs($conn);
    while ($row = mysql_fetch_object($dbs)) {
    echo $row->Database;
    }
    // if wordpress is in the list try a query
    $sql = "SELECT option_name FROM wordpress.wp_options";
    $result = mysql_query($sql)
    or die($sql);
    echo mysql_num_rows($result);
    ?>

    Im having the same problem and I use the script that appears above…
    The page shows the number 118.
    Additional info…
    PHP 5.2.0, MySql 5.0.27, IIS 6.0

    Following some instructions published in this forums, I put a code that shows the mysql error… that’s what I obtained:

    Error: Access denied for user ‘wordpress’@’localhost’ (using password: YES);

    Help!

    Seems to me that your wordpress user doesn’t have rights to access the wordpress database from localhost. If you use the following script, what happens?

    <?php

    $conn = mysql_connect(‘localhost’,’wordpress’,[password]);

    if (!$conn) {
    die (‘no connection’);
    }

    $selectdb = mysql_select_db(‘wordpress’, $conn);

    if (!$selectdb) {
    die (‘can\’t use wordpress: ‘.mysql_error());
    } else {
    echo ‘no error’;
    }
    ?>

    If you can connect to the server but can’t use the db then you need to allow your wordpress user to use the db from localhost.

    Your problem is most likely caused by the fact that php is not finding the mysql socket (see:http://docs.info.apple.com/article.html?artnum=302977). The solution is to update your php.ini file and set:

    mysql.default_socket =/tmp/mysql.sock

    restart the web server and you should be good to go

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Unable To Connect To Mysql’ is closed to new replies.