Title: Database Password?
Last modified: August 19, 2016

---

# Database Password?

 *  Resolved [rforster](https://wordpress.org/support/users/rforster/)
 * (@rforster)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/database-password-1/)
 * Man I feel dumb. I’m trying to access the WP database via some code on a page
   to pull posts from a select statement. What the heck is my password? (!) I use:
   
   <? $dbh=mysql_connect (“localhost”, “Mysite_wrpd1”, “PASSWORD”) or die (‘I cannot
   connect to the database because: ‘ . mysql_error()); mysql_select_db (“Mysite_wrpd1”);
   echo “<p>Database selected…\n”;
 * I have a DB called “lists” with a few tables in it and it lets me do select statements
   and all is well. Works great. I can’t for the life of me remember any other password
   than the one I use to get into the dashboard.
 * Am i missing something here? Or is my database alrady selected and just select
   from the posts table?
 * Thanks!

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

 *  Thread Starter [rforster](https://wordpress.org/support/users/rforster/)
 * (@rforster)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/database-password-1/#post-786282)
 * It appears the connection is still open so if you try to connect it fails.
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/database-password-1/#post-786283)
 * the connection is open because wordpress is connected. you need to use the new_link
   parameter. read this more more info:
 * [http://us.php.net/function.mysql-select-db](http://us.php.net/function.mysql-select-db)
 *  Thread Starter [rforster](https://wordpress.org/support/users/rforster/)
 * (@rforster)
 * [17 years, 10 months ago](https://wordpress.org/support/topic/database-password-1/#post-786383)
 * Hey thanks for this. Wish I new more about php mysql but for the most part it
   made sense.

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

The topic ‘Database Password?’ is closed to new replies.

 * 3 replies
 * 2 participants
 * Last reply from: [rforster](https://wordpress.org/support/users/rforster/)
 * Last activity: [17 years, 10 months ago](https://wordpress.org/support/topic/database-password-1/#post-786383)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
