WordPress.org

Ready to get started?Download WordPress

Forums

LAN computer unable to connect to DB (4 posts)

  1. crstauf
    Member
    Posted 1 year ago #

    Running WAMP, accessing on localhost works fine. I was able to figure out how to open WAMP to my LAN, (define('DOMAIN_CURRENT_SITE', 'xxx.xxx.xxx.xxx');) and I can access it, but I get WordPress' unformatted "Error establishing database connection" error. I'm stuck.

    Changing DB_HOST to my network IP gives me wp_die screen. With wp_debug set to true, I get the error "Host is not allowed to connect to this MySQL server"

    Either I've set my wp-config.php up incorrectly, or I need to change a setting in one of the config files of Apache, MySQL.

    Other than one change I made to httpd.conf to allow for network connection, all settings of php, apache, mysql are the same: mysql user is root with blank password.

    (I'm running multi-site, but I don't think that should matter much..?)

    Any thoughts here? Thanks.

  2. michael.mariart
    Member
    Posted 1 year ago #

    There's no reason to chagne DB settings at all if it works, and you don't need to define DOMAIN_CURRENT_SITE. Why do you think that you need ot change the DB settings to the IP or something other then "localhost"?

  3. crstauf
    Member
    Posted 1 year ago #

    Well, I changed DOMAIN_CURRENT_SITE because if I left it at localhost, and then accessed the site from my laptop, it's localhost would appear, not the host of the network server (as WordPress changes the URL to the value of DOMAIN_CURRENT_SITE.

    Secondly, once I change DOMAIN_CURRENT_SITE to the network IP of the machine running WAMP, I am clearly able to access WordPress from the host, but I am being denied connection to the database, as I described above.

    It is only partially working. I am thinking that something must be changed, since it's not working: either in wp-config.php, or in one of the config files of Apache/MySQL.

    Thanks.

  4. esmi
    Forum Moderator
    Posted 1 year ago #

    See Changing_The_Site_URL for details of how to do this.

Topic Closed

This topic has been closed to new replies.

About this Topic