Title: Local WP/Remote Database login problem
Last modified: August 22, 2016

---

# Local WP/Remote Database login problem

 *  [EduardoV5](https://wordpress.org/support/users/eduardov5/)
 * (@eduardov5)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/local-wpremote-database-login-problem/)
 * Hi all,
 * I got my local WordPress codebase successfully connecting to my remote database
   by editing the wp-config.php with new database connection strings. I also added
   my ip address on my remote databases allowable hosts.
 * I can hit my homepage fine locally, however, when I try to login and go to /wp-
   admin, it redirects me to the live site I have running on my remote host.
 * So this works great:
 * [http://localhost/mysite.com/](http://localhost/mysite.com/)
 * but this:
 * [http://localhost/mysite.com/wp-admin](http://localhost/mysite.com/wp-admin)
 * redirects me to:
 * [http://www.mysite.com/wp-admin](http://www.mysite.com/wp-admin)
 * Thoughts?

Viewing 1 replies (of 1 total)

 *  Thread Starter [EduardoV5](https://wordpress.org/support/users/eduardov5/)
 * (@eduardov5)
 * [11 years, 3 months ago](https://wordpress.org/support/topic/local-wpremote-database-login-problem/#post-5790109)
 * I added the following to my wp-config.php
 * define(‘WP_HOME’,’[http://localhost/mysite.com&#8217](http://localhost/mysite.com&#8217););
   
   define(‘WP_SITEURL’,’[http://localhost/mysite.com&#8217](http://localhost/mysite.com&#8217););
 * and it’s working fine now.
 * This means though, that local and remote wp-config.php files will be different,
   even if they both point to the same database.

Viewing 1 replies (of 1 total)

The topic ‘Local WP/Remote Database login problem’ is closed to new replies.

## Tags

 * [login](https://wordpress.org/support/topic-tag/login/)
 * [Remote](https://wordpress.org/support/topic-tag/remote/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)

 * In: [Localhost Installs](https://wordpress.org/support/forum/localhost-installs/)
 * 1 reply
 * 1 participant
 * Last reply from: [EduardoV5](https://wordpress.org/support/users/eduardov5/)
 * Last activity: [11 years, 3 months ago](https://wordpress.org/support/topic/local-wpremote-database-login-problem/#post-5790109)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
