Hi,
I’ve been searching the net for the last few hours on the issue and tried almost everything I saw, but with no avail.
I created a wordpress site in DO using “OpenLiteSpeed WordPress 5.3 on Ubuntu 18.04” the one click option and I wanted to connect to the MySql db remotely. I want to create external windows app and fetch data from the database. I tested it by attempting to connect through my Navicat app (mysql interface) and telnet ip 3306, but connection failed.
As of the moment, here is what I have tried.
Adding ufw allowing 3306 port, and then ufw enable. After hitting ufw status verbose, it shows that the port is already allowed.
Adding Listeners to port 3306 in the OpenLiteSpeed portal.
Running scripts in the phpmyadmin to GRANT ALLOW ALL PRIVILEGES the root user, and my custom user.
Creating user to my phpmyadmin and allowing GRANT access to database.
After these, my results are:
telnet to ip:port show Connection Failed.
Unable to access through my navicat interface. (Also tried, Mysql Workbench).
Any help or any topics they can point me to is much appreciated.
Thanks
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!
Hi there @jonasalmocera,
This sounds like that you have a firewall blocking the MySQL port. I believe that the OpenLiteSpeed WordPress image from the Marketplace comes with UFW enabled, so to allow access to port 3306 you can use the following command:
sudo ufw allow mysql
For more information on how to add and remove firewall rules, you can follow this tutorial here:
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-18-04
As a side note, I would strongly advise against opening access to MySQL for the world due to security reasons. What you could do instead is to use an SSH tunnel to connect to MySQL. Here’s how to do that with Workbench.
Hope that this helps! Regards, Bobby
Adding Listeners to port 3306 in the OpenLiteSpeed portal.
don’t do this
Running scripts in the phpmyadmin to GRANT ALLOW ALL PRIVILEGES the root user, and my custom user.
Creating user to my phpmyadmin and allowing GRANT access to database.
make sure you set users can be access from remote , e.g.
root@123.123.123.123 , where 123 is your other IP
or
root@%
then edit your /etc/my.cnf , make sure it’s not bind to 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.