2

My connection code from wp-config.php

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wordpress');

/** MySQL database username */
define('DB_USER', 'wordpress');

/** MySQL database password */
define('DB_PASSWORD', 'MYPASSWORD');

/** MySQL hostname */
define('DB_HOST', 'DBProcessName.db');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

Works fine online, but not locally.

What must I change so this works both locally and when accessing the site online?

Username
  • 3,463
  • 11
  • 68
  • 111
  • Fix it under: `define('DB_HOST', 'DBProcessName.db');` This should be a URL or IP of the Host. – Twisty May 08 '15 at 17:55
  • Also, if you're copying this file over a lot, can make a conditional statement based on details in `$_SERVER`, to define a different host depending on where the file is located. – Twisty May 08 '15 at 17:57
  • Changing the `'DBProcessName.db'` to my site's URL or its IP address gives me the error "ERROR ESTABLISHING DATABASE CONNECTION" – Username May 08 '15 at 18:05
  • 2
    You will need to check with your host to find out what host name or IP is correct for this connection. If they do not allow external connections, that is a different issue. – Twisty May 08 '15 at 18:08

0 Answers0