Title: ltward's Replies | WordPress.org

---

# ltward

  [  ](https://wordpress.org/support/users/ltward/)

 *   [Profile](https://wordpress.org/support/users/ltward/)
 *   [Topics Started](https://wordpress.org/support/users/ltward/topics/)
 *   [Replies Created](https://wordpress.org/support/users/ltward/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/ltward/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/ltward/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/ltward/engagements/)
 *   [Favorites](https://wordpress.org/support/users/ltward/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing a database connection](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/)
 *  Thread Starter [ltward](https://wordpress.org/support/users/ltward/)
 * (@ltward)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/#post-1664138)
 * Should probably mention, the reason I thought to mess with etc/hosts is because
   when I tried to ping localhost, instead of pinging 127.0.0.1 it was pinging my
   real IP and showing my FQHN.
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing a database connection](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/)
 *  Thread Starter [ltward](https://wordpress.org/support/users/ltward/)
 * (@ltward)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/#post-1664135)
 * OH, how excited am I???
 * In C:\windows\system32\drivers\etc\hosts, I had uncommented both the localhost
   lines:
 *     ```
       127.0.0.1     localhost
            ::1     localhost
       ```
   
 * I re-commented the ipv6 line and left the ipv4 line uncommented:
 *     ```
       127.0.0.1     localhost
       #     ::1     localhost
       ```
   
 * AND IT WORKS!!!!
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing a database connection](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/)
 *  Thread Starter [ltward](https://wordpress.org/support/users/ltward/)
 * (@ltward)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/#post-1664133)
 * I deleted WP and re-installed it using a new site name, MySQL database name, 
   userid, and password.
    Still getting “Error establshing a database connection”
   when I click the launch link (it takes me to index.php and I get the error).
 * I can login to MySQL using the credentials shown in wp-config.php
    I can use 
   the database. When I show tables, there are none.
 * Any ideas from anyone?
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing a database connection](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/)
 *  Thread Starter [ltward](https://wordpress.org/support/users/ltward/)
 * (@ltward)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/#post-1664109)
 * So, in desperation, I uninstalled MySQL.
    I removed it via Control Panel, then
   via the installer, then I deleted all the files under c:\Program Files \MySQL.
 * Then I re-installed MySQL, installed WordPress… and when I click “launch” I still
   get the “Error establishing a database connection”.
 * Anyone got any ideas of what I could try next? I’m willing to do the work here,
   I’m just flat out of ideas.
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing a database connection](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/)
 *  Thread Starter [ltward](https://wordpress.org/support/users/ltward/)
 * (@ltward)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/#post-1664107)
 * I have determined that the error is being thrown by
    function dead_db() in wp-
   includes/functions.php
 * From what I can determine, dead_db() is only ever called from is_blog_installed(),
   also in functions.php
 * dead_db() is getting called, but I never see a message about one or more database
   tables being unavailable.
 * I also can’t figure out why that portion of the code is even getting executed
   at all; before re-installing I dropped the database completely. And now after
   re-installing, the database exists but it contains no tables.
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing a database connection](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/)
 *  Thread Starter [ltward](https://wordpress.org/support/users/ltward/)
 * (@ltward)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/#post-1663839)
 * Found two “newsadmin” users in the mysql database; one was associated with “hostname”
   and the other with “localhost”.
 * Deleted the one associated with “hostname”, no joy.
    Ensured the password was
   what I wanted by running the following mysql command: GRANT ALL PRIVILEGES ON
   news.* TO “newsadmin”@”localhost” -> IDENTIFIED BY “secret”;
 * Still getting “Error establishing a database connection” from my browser, still
   able to access mysql with the credentials in wp-config.php
 * Tried going to [http://…/wp-admin/setup-config.php](http://…/wp-admin/setup-config.php)
   and got
    The file ‘wp-config.php’ already exists. If you need to reset any of
   the configuration items in this file, please delete it first. You may try installing
   now.
 * Clicked on “installing” and it took me to install.php which gave “Error connecting
   to database”.
 *   Forum: [Installing WordPress](https://wordpress.org/support/forum/installation/)
   
   In reply to: [Error establishing a database connection](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/)
 *  Thread Starter [ltward](https://wordpress.org/support/users/ltward/)
 * (@ltward)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-230/#post-1663832)
 * Forgot to mention – this is a dedicated installation, not a hosted solution.

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