WordPress.org

Ready to get started?Download WordPress

Forums

wp_config.php And 2 Server Locations. Bet Nobody Can Help (10 posts)

  1. slydawgg
    Member
    Posted 6 years ago #

    I have been given some webspace on my college account to do whatever I would like, so I want to make a Blog. Unfortunately I do not have access to any type of mySQL except with a hosting company.
    In other words, I want my blog to be this:
    http://www.xxxxxxxx.edu/myname/WPBlog

    But at this time, I don't know what to put in to the following areas of my wp_config.php file:

    define('DB_NAME', 'wordpress'); // The name of the database
    define('DB_USER', 'username'); // Your MySQL username
    define('DB_PASSWORD', 'password'); // ...and password
    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value

    ================================
    Is there a way to point to an external IP or URL??? Or is this impossible to do with WordPress...

  2. mrmist
    Forum Janitor
    Posted 6 years ago #

    You replace DB_HOST with the name or IP address of your mysql server. But it would need to be routable from your web space, which may be an issue if your college stuff is firewalled.

  3. Cephus
    Member
    Posted 6 years ago #

    mrmist is right. That's a quick and easy answer, I think you lost your bet.

  4. slydawgg
    Member
    Posted 6 years ago #

    Okay, thanks for your answers - but unfortunately they still do not work. When I replace "localhost" with the IP address of the server, I get the following message from WordPress:

    Error establishing a database connection

    This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at 66.98.222.27 . This could mean your host's database server is down.

    Do I need for the IP address to also contain the FULL path to the database? If so, could somebody give me an example? I must be missing something on this install...

    Thanks!

  5. whooami
    Member
    Posted 6 years ago #

    localhost isnt going to work -- because you already said you need it to connect to another server. localhost isnt another server - its the same box wordpress is on.

    The answer above was correct -- you use the IP to the box that has the db you want to connect to.

    If it doesnt connect, that just means that that server isnt set up to allow remote connections -- thats quite common place.

    Theres no full path nonsense.. its an IP and an optional port# if, for some reason, mysql isnt listening on 3306.

  6. drmiketemp
    Member
    Posted 6 years ago #

    Your host may also be blocking outbound connections via a firewall on that port as well. I would suggest getting with them and asking about it.

  7. whooami
    Member
    Posted 6 years ago #

    you arent necessarily going to use 3306 outbound, if thats what you are suggesting, Mike ..its prolly a high unassigned port .. but that said, most/all/some outbound connections could be blocked, but I think in that case, the error would be different .. I dont know though, havent tested it.

  8. drmiketemp
    Member
    Posted 6 years ago #

    That's what I was thinking. When port 80 outbound is blocked for Akismet, you get a weird error about not having the corrert API. I'm thinking that wp just doesn't know how to correctly report the error and is throwing up that instead.

  9. whooami
    Member
    Posted 6 years ago #

    theres a better chance that remote incoming mysql connections are blocked. There is a very specific way to set those up in mysql, assuming theyre even allowed via the host- for instance a small orange allows them, but like I said you have to set them up first -- ip based etc.. they don't just magically work.

    MySQL is way too much of an exploit target for shared hosts to leave access wide open for everyone to make remote connections..

    slydawgg, by the way, all you need to do really to test whether or not remote connections are even allowed is telnet to that IP on port 3306 from a shell, or even your own windows box -- windows DOES have telnet

    telnet IP 3306 ..

    I tried the box (i believe) the site in your profile is on .. it wouldnt connect.

  10. drmiketemp
    Member
    Posted 6 years ago #

    theres a better chance that remote incoming mysql connections are blocked.

    Oh, that. Yes. I agree. I was only thinking about outbounds.

    Sorry about that.

Topic Closed

This topic has been closed to new replies.

About this Topic