• Resolved paulgweb

    (@paulgweb)


    Hello, I am posting as a last resort – no one i could find had this exact problem. Thanks to anyone who helps!

    I want to install WP on a subdomain: blog.myname.org

    I created the db, user, pwd; and confirmed via phpmyadmin that they exist and work.

    the “wp-config.php” file is correct as far as user details… but:

    the /wp-admin/install.php script says: Error establishing a database connection.

    I suspect that the db’s address is NOT localhost since i’m calling it from the subdomain? Here’s where i’m lost and no googling has found answers.

    The host is a reseller package on Rackspace, using Plesk 7. Why won’t localhost work? I seem to be falling into the 1% of times when localhost does not work as a value in the WP script… help?!

    thx, paul

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter paulgweb

    (@paulgweb)

    If this helps, phpinfo reports:

    https://blog.saltwater.org/testphp.php

    There seems to be an ioncube loader module. is that year-old bug still affecting WP ?

    Thread Starter paulgweb

    (@paulgweb)

    Another thought: is there a problem with naming the database “WordPress” ?

    Thread Starter paulgweb

    (@paulgweb)

    Hmm, no, there seems to be no problem with a database named “WordPress”… i just renamed to “blog”

    The server is running MySQL 4.1.12

    Ioncube is for other stuff; I’d be highly surprised if it’s being used by WordPress.

    Just for understanding, the actual location for blog.domain.com would be domain.com/blog. How you set up domain.com/blog to be accessed as blog.domain.com is another matter, however.

    Lastly, on some servers, this:
    define('DB_HOST', 'localhost');
    might need to be this:
    define('DB_HOST', 'site.com');

    Since you can access blog.domain.com; it would appear that the subdomain (blog.) is set up correctly. Since accessing the install.php gives us the usual “Error establishing a database connection”, that indicates that either (1) the database is not actually set up yet, or (2) the info in wp-config.php is incorrect.

    Check those, and try install.php again. If that doesn’t work, contact your host to ascertain what DB_HOST should be.

    One last thing: if your web hosting account uses cPanel, and you set up a database via cPanel which you named “blog”, cPanel appends that to your username. So if, for example, your username is “user1”, cPanel would change it to this:

    user1_blog

    Thread Starter paulgweb

    (@paulgweb)

    Thanks very much for the help! i think the subdomain that my control panel Plesk7 creates is a “true” subdomain, not a dns trick.
    so, on the server, there is an outside-the-httpdocs directory called “subdomains”, within which is a unique “httpdocs” directory. This subdomain cannot be viewed by pointing to domain.com/blog.

    Thread Starter paulgweb

    (@paulgweb)

    Too bad: changing the config to:

    define('DB_HOST', 'mysite.com');

    didn’t work…

    This may seem silly, but it’s something I forget to do all the time and it would throw out that or a similar error.

    Did you remember to add the user to the database?

    Good point, jonimueller. I used to do this manually, but in cPanel, there are three steps:

    (1) Create a database
    (2) Create a new user (and password)
    (3) Add the user to the database

    That sets up the new database, and allows that particular user to use it. In such a case, the DB_HOST may be localhost, or may not … but at least the database is usable.

    I see WordPress is loaded to blog.saltwater.org, so you’ve set up the subdomain itself correctly. Did you enter the mySQL info into the config file correctly? That was the only tricky part of getting this to run for me.
    JOE

    Thread Starter paulgweb

    (@paulgweb)

    hi all, glad to see your input… to answer the questions: yes, the db user is correctly set up. phpmyadmin confirms this. the control panel is PLESK 7 (not cPanel) and so makes it very easy to set up db users. I can vouch that the db is usable. I’ve added tables to it to test.

    So… the mystery remains. I think it’s localhost vs the subdomain. but i don’t know what WordPress is expecting for the server path. ??

    my host reseller doesn’t have weekend tech support, so i’m on my own for now.

    Quite often the mysql server is a completely different box, so using either localhost or yourdomain.com won’t work. (My web host and mysql server are totally different)

    You’ll need to put the actual server address of the mysql server in that config info, which you must have somewhere

    Thread Starter paulgweb

    (@paulgweb)

    Hi all, my host found the cause! He confirmed that localhost was indeed correct (subdomains are still local to the server)… the issue was that PLESK 7 was truncating the db user password to less than 14 characters, and my pwd was 16 characters. Apparently a bug in Plesk, since it didn’t flag that long pwd as prohibited.

    Now the blog is working fine!

    Thanks everyone…

    Excellent; glad it’s sorted out!

    (Isn’t this fun? <grin>)

    That is definitely good to know for any other Plesk users out there! And it’s prolly a good idea to keep your passwords shorter than 6-8 characters.

    Glad it’s solved!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘installing wordpress to subdomain – localhost?’ is closed to new replies.