Title: (install.php) Error establishing a database connection
Last modified: August 19, 2016

---

# (install.php) Error establishing a database connection

 *  [RArocks12](https://wordpress.org/support/users/rarocks12/)
 * (@rarocks12)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/installphp-error-establishing-a-database-connection-1/)
 * I have installed WordPress several times in the past and everything has been 
   extremely simple and that is what keeps me coming back to it. I finally acquired
   a new server so I can finally get my blog back online. I installed the latest
   Ubuntu server 10.04 (PPC version) with LAMP and OpenSSH selected.
 * On the fresh install I then downloaded the latest.tar.gz and unzipped into the
   root of the web directory (/var/www).
 *  – I created the database, and database user as instructed on the installation
   guide.
    – I then created a wp-config.php file and entered in the correct information–
   I tried running serveraddress/wp-admin/install.php and was greeted with the WordPress
   Error, Error establishing a database connection.
 * I have checked and rechecked to make sure the wp-config.php data is correct so
   I don’t think that is the problem. Apache is running, mysql is running, and I
   can log in using the WordPress user by running “mysql -u user -p” on the command
   line and accessing my designated WordPress database. Anyone have any clue on 
   what could be going on here, or anything else I can try?

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

 *  Thread Starter [RArocks12](https://wordpress.org/support/users/rarocks12/)
 * (@rarocks12)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/installphp-error-establishing-a-database-connection-1/#post-1607500)
 * I just wrote up a quick php file to test being able to connect to mysql:
 *  mysql_connect(“localhost”, “username”, “password”) or die(mysql_error());
    mysql_select_db(“
   wordpress”) or die(mysql_error()); echo “Connected to database”;
 * This worked and I was able to connect using the designated database and user 
   that I’m using in the wp-admin/install.php file.
 *  [jbisset94](https://wordpress.org/support/users/jbisset94/)
 * (@jbisset94)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/installphp-error-establishing-a-database-connection-1/#post-1607807)
 * Hi,
 * I’m having exactly this problem. Ubuntu 10.04. Can access the DB via mysql command
   line, also from phpmyadmin, but can’t get wordpress installation going at all.
   Always the Error establishing connection to database.
 * Did you solve this?
 * James.
 *  [jbisset94](https://wordpress.org/support/users/jbisset94/)
 * (@jbisset94)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/installphp-error-establishing-a-database-connection-1/#post-1607808)
 * Hi again,
 * I found the answer. I was following the instructions at [http://codex.wordpress.org/Installing_WordPress](http://codex.wordpress.org/Installing_WordPress).
   I followed the Step2 instructions for phpMyAdmin. Unless I got something wrong,
   these didn’t work. I sorted out by typing the grant privileges instructions shown
   in the mysql command line section below.
 * James.

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

The topic ‘(install.php) Error establishing a database connection’ is closed to 
new replies.

## Tags

 * [database connection](https://wordpress.org/support/topic-tag/database-connection/)
 * [install.php](https://wordpress.org/support/topic-tag/install-php/)
 * [wp-config.php](https://wordpress.org/support/topic-tag/wp-config-php/)

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 3 replies
 * 2 participants
 * Last reply from: [jbisset94](https://wordpress.org/support/users/jbisset94/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/installphp-error-establishing-a-database-connection-1/#post-1607808)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
