• Hi all. I’ve searched the install support forum and haven’t found an (simple enough?) answer to my particular “Error establishing a database connection” problem. Heretofore, I had WP1.2 installed in my public_html directory (https://maindomain.tld/wordpress) and all was peaches (and it still works fine.) Now I’m trying to install WP1.5 in the subdirectory to which a new addon domain points. (https://newdomain.tld/wordpress – which is the same thing as https://maindomain.tld/newdomain_folder/wordpress)

    I created a new MySQL database and gave all privileges to the db_user I had already created for my first WP. The db_host is ‘localhost’ as the connection strings indicate. So the only things different to my original WP, besides version, are db_name, db_password, and the location of the WP files.

    This leads me to believe that the connection error has to do with having WP in a subdirectory. I see in the documentation and in various posts here that that needn’t be a problem. I’ve also seen some posts that indicate that some URLs (or URIs?) in the WP code may need to be changed for this to work, but I could not deduce from said posts where those bits of code might be.

    I really would like to keep the new WP in the addon domain’s folder. Any light you could shed (including a pointer to a relevant post I may have missed) would be much appreciated.

Viewing 3 replies - 1 through 3 (of 3 total)
  • It won’t be where WP is located.
    If WP cannot connect to the database, then the error is in one of the 4 pieces of info in the config file – honestly, it has nothing to do with where WP actually is.

    Have you checked your info for whitespace ?

    Thread Starter drogheda

    (@drogheda)

    Trying this reply again. First post got eaten by a db connection error. (Oh, the irony.)

    It’s good to know that location doesn’t matter. I did not see that clearly elucidated elsewhere. And, since whitespace wasn’t the issues and those four things in the config file were correct in and of themselves, I deduced that the problem must be database-related. (“My, so clever!”, you’re saying.)

    And lo, herein lay the fix: I created a new db_user and gave it full privileges in the new WP. When I used the new db_user in the config file, the connection error went away. Now why I can not use the same db_user for both WP databases is a mystery to me (and yes, said user had full privileges to both dbs.) If any one had thoughts on that, I’d be glad to hear’em. But otherwise, ::shrug::

    Thanks for your help, podz.

    Likely there was an error of some kind in the MySQL permissions of the first db_user. When you re-created the new db_user you shook all of the gremlins out.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Subdirectory install and database connection woes.’ is closed to new replies.