Please excuse my ignorance, as I'm entirely self taught (HTML, CSS, and some JS and PHP) as a hobby, and SSH is all fairly new to me.
I originally built a static website for my wife's childminding business using HTML and CSS. Then after a while, made it into a PHP template.
It would be good if she could update it herself, so I'd like to create a WordPress template.
I've currently got a local WordPress install (using XAMPP), which is working fine, and the template is coming along nicely.
I've also created a droplet on DigitalOcean with a WordPress install, which is working fine, and she's started editing the content for the site on here.
I'm editing the template files and CSS locally, and pushing it via SFTP.
I'm looking to connect my local WordPress site to the DigitalOcean database remotely, so that I can edit the content.
I've connected to the db using MySQL WorkBench, so I know it's possible to connect remotely.
I have tried copying the wp-config file from DO to my local machine, but when I do this, I get the error Error establishing a database connection
.
I think the issue is with the DB_HOST
which is currently set to localhost. When I change it to my DO IP address 46.xxx.xx.68, and change the DB_USER = root
and DB_PASSWORD = ***********
.
When I initially tried connecting to the DB via Workbench, I set the SSH Hostname and the MYSQL hostname to my 46.xxx.xx.68 IP address, which didn't work, and instead had to set the MYSQL Hostname to 127.0.0.1.
I've done some reading online, and as I understand it, I'll need to SSH into the server, and forward my connection to 127.0.0.1.
I tried using this tutorial here, which is now slightly dated.
But was unsure what to replace [email protected]
with.
I also saw this post question: Connect to remote database using Localhost install but there wasn't actually an answer of "you can't do it"
Any help or guidance would be appreciated.