Title: Modify the database
Last modified: August 19, 2016

---

# Modify the database

 *  [Alessandro Di Ruscio](https://wordpress.org/support/users/thirdeyeblind82/)
 * (@thirdeyeblind82)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/modify-the-database/)
 * Hi guys!
    I’m working on my website on my computer and sometimes I upload changes
   and database online just to check the result.
 * Everytime I upload the database online, I have to change manually some values
   like “siteurl” and “home” inside the wp-option table!
 * Do I have to do this change everytime or there is an easier way?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [govpatel](https://wordpress.org/support/users/govpatel/)
 * (@govpatel)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/modify-the-database/#post-1971913)
 * when you use database locally and then online the urls change and you could change
   them in settings general before you export database locally and change them back.
 *  Thread Starter [Alessandro Di Ruscio](https://wordpress.org/support/users/thirdeyeblind82/)
 * (@thirdeyeblind82)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/modify-the-database/#post-1971995)
 * Anyway, I should change these settings everytime I move the website, is that 
   right?
 *  [govpatel](https://wordpress.org/support/users/govpatel/)
 * (@govpatel)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/modify-the-database/#post-1971996)
 * yes there no other way as you changing from localhost to online server.
 *  [frederic_giroux](https://wordpress.org/support/users/frederic_giroux/)
 * (@frederic_giroux)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/modify-the-database/#post-1972428)
 * In fact there is a way ! In your wp-config.php, replace these lines ( 19 – 28):
 *  /** The name of the database for WordPress */
    define(‘DB_NAME’, ‘wp-premierTemplate’);
 *  /** MySQL database username */
    define(‘DB_USER’, ‘root’);
 *  /** MySQL database password */
    define(‘DB_PASSWORD’, ”);
 *  /** MySQL hostname */
    define(‘DB_HOST’, ‘localhost’);
 * **By these lines : **
 *  $local = false;
    if ( stristr($_SERVER[‘HTTP_HOST’], ‘local’) || substr($_SERVER[‘
   HTTP_HOST’], 0, 7) == ‘192.168’) { $local = true; }
 *  // Sélectionne les informations de connexion à la BD
    // selon l’environnement
   d’exécution if ($local) { define(‘DB_NAME’, ‘your_bd_name’); /** The name of 
   the database for WordPress */ define(‘DB_USER’, ‘root’); /** MySQL database username*/
   define(‘DB_PASSWORD’, ”); /** MySQL database password */ define(‘DB_HOST’, ‘localhost’);/**
   MySQL hostname */ } else { $bd_server = ‘your_server’; $bd_username = ‘your_username’;
   $bd_password = ‘your_password’; $bd_name = ‘your_bd_name’; }
 * This will check out if you are in local or not !

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Modify the database’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [table](https://wordpress.org/support/topic-tag/table/)
 * [wp-option](https://wordpress.org/support/topic-tag/wp-option/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [frederic_giroux](https://wordpress.org/support/users/frederic_giroux/)
 * Last activity: [14 years, 3 months ago](https://wordpress.org/support/topic/modify-the-database/#post-1972428)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
