Hi there.
Just a quick question regards a database that I am migrating from an old shared hosting setup, to a new shiny London-based VPS.
These are the 4 definitions within the wp-config.php file which connect the database.
/** The name of the database for WordPress */
define('DB_NAME', 'eg');
/** MySQL database username */
define('DB_USER', 'eg');
/** MySQL database password */
define('DB_PASSWORD', 'eg');
/** MySQL hostname */
define('DB_HOST', 'localhost');
My question, when connecting to a newly imported database (imported via PHPMyAdmin) should the DB_Host be localhost, or the IP address of the Droplet? What are the differences?
Thanks a lot.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The DB_HOST variable should be set to localhost. Unless you setup another Droplet and want to run mysql on it and connect to it from your current Droplet. localhost means your own Droplets local network (not exposed to the internet) and it maps to 127.0.0.1 (so localhost = 127.0.0.1).
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.