Title: Error establishing a database connection
Last modified: August 18, 2016

---

# Error establishing a database connection

 *  [ctfb](https://wordpress.org/support/users/ctfb/)
 * (@ctfb)
 * [22 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection/)
 * Hi
    Here’s my problem. I have direct access (through remote desktop) to a windows
   2003 server (I’m the sa). I wanted a blogging program but the non perl/php/mysql
   options sucked so I did some research and decided to try wordpress. Having only
   used javascript/vbscript/asp/t-sql etc. (all microsoft, all the time), but having
   experience building web sites and apps I figured this would be a fun learning
   experience. It took me awhile to install PHP 4.3.3 and MySQL 3.23.49. I have 
   wordpress set-up as a virtual directory as /wp/ in the root of my site. when 
   I run /wp/wp-admin/install.php I get the error establishing db connection error.
   My wp-config file looks like this `<?php /** WordPress's config file **/ /** 
   http://wordpress.org/ **/ // ** MySQL settings ** // define('DB_NAME', 'wordpress');//
   The name of the database define('DB_USER', 'blog_user'); // Your MySQL username
   define('DB_PASSWORD', 'blog_password'); // ...and password define('DB_HOST', '
   localhost'); // 99% chance you won't need to change this value // Change the 
   prefix if you want to have multiple blogs in a single database. $table_prefix
   = 'wp_'; // example: 'wp_' or 'b2' or 'mylogin_' // Change this to localize WordPress.
   A corresponding MO file for the // chosen language must be installed to wp-includes/
   languages. // For example, install de.mo to wp-includes/languages and set WPLANG
   to 'de' // to enable German language support. define ('WPLANG', ''); /* Stop 
   editing */ $server = DB_HOST; $loginsql = DB_USER; $passsql = DB_PASSWORD; $base
   = DB_NAME; define('ABSPATH', dirname(__FILE__).'/'); // Get everything else require_once(
   ABSPATH.'wp-settings.php'); ?> I use mysqlcc to administer the database. I have
   created a database called wordpress and givin the user: blog_user full permissions.
   Using this interface connected as the ‘blog_user” I can create/delete tables,
   etc. I have skimmed through the wp-install.php code looking for where it throws
   this error but can’t figure out where it is going wrong. If this was asp and 
   SQL server I am confident I could troubleshoot this… I am having a feeling that
   the problem lies with php accessing MySQL. I don’t understand enough of the syntax
   to write a script to test the database connection from my web page. This is probaly
   either a file or network permission problem but I don’t know. I am still new 
   to this server OS and still figuring out its quirks. Any help with this would
   be appriciated. Thanks

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Mark (podz)](https://wordpress.org/support/users/podz/)
 * (@podz)
 * [22 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection/#post-61521)
 * `define('DB_PASSWORD', 'blog_password'); // ...and password`
    Is that your blog
   password or your mysql password ? It should be the latter. Have you accidentally
   included a space in any of the details in that file ? I did this a couple of 
   days ago with the db name.
 *  [Sushubh](https://wordpress.org/support/users/sushubh/)
 * (@sushubh)
 * [22 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection/#post-61522)
 * prefixes are a pain in the ass too on shared sql servers.
 *  Thread Starter [ctfb](https://wordpress.org/support/users/ctfb/)
 * (@ctfb)
 * [22 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection/#post-61541)
 * `define('DB_PASSWORD', 'blog_password'); `is the MySQL password. I don’t have
   a blog password because I can’t get it to install. I am not on a shared server.
   Its dedicated and I have complete access. The file fragment above is a copy of
   my actual wp-config.php.
 *  [Sushubh](https://wordpress.org/support/users/sushubh/)
 * (@sushubh)
 * [22 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection/#post-61550)
 * i dont think password has a prefix like databases and usernames have on some 
   servers… by sharing i meant many domains running on 1 server thus u get a database
   name like:
    sitename_databasename sitename_username
 *  Thread Starter [ctfb](https://wordpress.org/support/users/ctfb/)
 * (@ctfb)
 * [22 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection/#post-61582)
 * I fixed the problem although now I have more. I removed the username and password
   I had created for the wordpress database and used root with no password. I don’t
   understand why this would work as I had assigned the ‘blog_user’ all permissions
   that I could with the mysqlcc admin tool. Anyways, now it crashes on step 3. 
   I am going to reinstall mysql and try again.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Error establishing a database connection’ is closed to new replies.

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 5 replies
 * 3 participants
 * Last reply from: [ctfb](https://wordpress.org/support/users/ctfb/)
 * Last activity: [22 years ago](https://wordpress.org/support/topic/error-establishing-a-database-connection/#post-61582)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
