WordPress.org

Ready to get started?Download WordPress

Forums

No connection to database (18 posts)

  1. patdundee
    Member
    Posted 5 years ago #

    Hi

    Just installed latest wordpress for one of my customers.
    Windows server 2003
    MySql 5.0
    MySql ODBC 3.51
    PHP 5

    Just ran the install.php and it errors saying cannot connect to database

    wp-config file was edited correctly giving server, database name, user, and pass.

    I can set up an ODBC and this connects immediately with the same details as supplied in the wp-config

    I can log into the database with MySql Front with the same details

    Any ideas guys?

    Many thanks
    Patrick

  2. patdundee
    Member
    Posted 5 years ago #

    Looking through the posts this seems to be a wide spread issue. Has any one got a resolution?

    Patrick

  3. starrynightnf
    Member
    Posted 5 years ago #

    I'm having the same problem...any one have any solutions?

    ~Leslie

  4. starrynightnf
    Member
    Posted 5 years ago #

    Nm...I got it. :D I had things written wrong in the wp-config.php. Sorry to bother everyone.

  5. thisisedie
    Member
    Posted 5 years ago #

    Patdundee you're POSITIVE the info in wp-config is correct? The DB host name?

  6. patdundee
    Member
    Posted 5 years ago #

    As far as I am aware it is. As mentioned I can actually connect via ODBC and I have a connection script in VBScript and in PHP and they both connect with no problem

    Please see below config below

    <?php
    // ** MySQL settings ** //
    define('DB_NAME','palm'); // The name of the database
    define('DB_USER','xxxxxx'); // Your MySQL username
    define('DB_PASSWORD','xxxxxx'); // ...and password
    define('DB_HOST','localhost'); // 99% chance you won't need to change this value
    define('DB_CHARSET','utf8');
    define('DB_COLLATE','');

    // Change each KEY to a different unique phrase. You won't have to remember the phrases later,
    // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/
    // to get keys generated for you, or just make something up. Each key should have a different phrase.
    define('AUTH_KEY', 'm=.k/w(o,?{6({rUCk|.Z$:U\'RL]]Nc6!aRW:T1\\F<Y)9Kis7m3.yFaU&VqX\'f#2'); // Change this to a unique phrase.
    define('SECURE_AUTH_KEY', 'J]bM@m3[63a=Ii?aufLC9jOzvQ=n-@.UzB(HcFKJmc^87q&.HGpkp^X#bLd$2p'); // Change this to a unique phrase.
    define('LOGGED_IN_KEY', '\\CL|YbotcN\\^Ec5<_wr}v1<DT?*%(tskIFP+6+;Rp~Xg!?;\'qIGG5|<Z{jYY@O'); // Change this to a unique phrase.

    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

    // Change this to localize WordPress. A corresponding MO file for the
    // chosen language must be installed to wp-content/languages.
    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', 'uk');

    /* That's all, stop editing! Happy blogging. */

    if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');
    require_once(ABSPATH . 'wp-settings.php');
    ?>

  7. Samuel B
    moderator
    Posted 5 years ago #

    One error
    define ('WPLANG', 'uk');
    this should be
    define ('WPLANG', '');

    Also, usually a windows host does not use
    "localhost" but certainly can.

  8. thisisedie
    Member
    Posted 5 years ago #

    Who's your host?

  9. patdundee
    Member
    Posted 5 years ago #

    Hi Guys
    Located the issue it was a port error in the Host Line

    Now that works OK But (PART 2 )

    Go to the install.php and the page loads absolutely fine (Had to put me sunnies on) Bright white page but guess what No Install set up page

  10. moshu
    Member
    Posted 5 years ago #

    Another host issue?

  11. thisisedie
    Member
    Posted 5 years ago #

    What's your URL?

  12. Samuel B
    moderator
    Posted 5 years ago #

  13. tiwari.servesh@gmail.com
    Member
    Posted 5 years ago #

    Error establishing a database connection
    hi i am new to use wordpress pls help me asap...
    i have given the db_name ,user name and passwords..but i could not..

  14. tiwari.servesh@gmail.com
    Member
    Posted 5 years ago #

    <?php
    // ** MySQL settings ** //
    define('DB_NAME', 'db_name'); // The name of the database
    define('DB_USER', 'user_name'); // Your MySQL username
    define('DB_PASSWORD', 'xxxxxx'); // ...and password
    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
    define('DB_CHARSET', 'utf8');
    define('DB_COLLATE', '');

    // Change each KEY to a different unique phrase. You won't have to remember the phrases later,
    // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/
    // to get keys generated for you, or just make something up. Each key should have a different phrase.
    define('AUTH_KEY', '1234567890!@#$%'); // Change this to a unique phrase.
    define('SECURE_AUTH_KEY', '!@#$%^&*1234'); // Change this to a unique phrase.
    define('LOGGED_IN_KEY', ')(*&^%$#@!'); // Change this to a unique phrase.

    // You can have multiple installations in one database if you give each a unique prefix
    $table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

    // Change this to localize WordPress. A corresponding MO file for the
    // chosen language must be installed to wp-content/languages.
    // For example, install de.mo to wp-content/languages and set WPLANG to 'de'
    // to enable German language support.
    define ('WPLANG', '');

    /* That's all, stop editing! Happy blogging. */

    if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');
    require_once(ABSPATH . 'wp-settings.php');
    ?>
    Error establishing a database connection

  15. alkalar
    Member
    Posted 5 years ago #

    My problem was more with HSphere than WordPress.

    -To do the job, Go to MySQL Server and add a database.
    -Name it anything you want.
    -Create a user with DBA powers for the DB.
    -Let's assume your website account is MYDOMAIN.COM and you've chosen to name your DB, "WPDB" and you user, "BIGBOSS".
    -You're going to end up with something like this:
    -Database name: MYDOMAI_WPDB
    -User name: MYDOMAI_BIGBOSS
    -Password: whatever you chose
    -Path to the domain: localhost
    This may not be correct. If you go back to the MySQL Server screen, you'll see the correct path at the top of the box. Copy and paste that path into your wp-config.php file. This is where I messed up.
    -Now go below and create some jaw-cruncher KEYs. The utility mentioned works great.

  16. alkalar
    Member
    Posted 5 years ago #

    Now, can anyone tell me if I'm supposed to restrict the access to the file area where WordPress lives? If so, what level?

  17. happyshm
    Member
    Posted 5 years ago #

    Hi,

    I would the same problem with database connection error...

    When I checked my error log from host server:

    Error: 2002 : Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at func.cgi line 250.
    DBI connect('database=princess_product;host=localhost','princess_product',...) failed: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) at func.cgi line 250
    We are not connected to database princess_product

    So, it is some kind of socket error. How to solve it please????urgent ...Thanks! :)

    sam

  18. happyshm
    Member
    Posted 5 years ago #

    Its ok now. It was 'localhost' wrongly put. Too bad I am in the 1%.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.