PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, November 8, 2022

[FIXED] How to connect mysql in DO droplet from specific ip?

 November 08, 2022     digital-ocean, droplet, ip, mysql, ssh     No comments   

Issue

As far as I understand my problem is about ip and network knowledge.

I have set up Mysql on Digital Ocean droplet. I want to connect to it from my local pc. Actually I did it by applying several steps like:

  • Setting up firewall and allowing all Ip's
  • Commenting out bind 127.0.0.1 in /etc/mysql/mysql.conf.d/mysqld.cnf

My problem is that I need to allow all ips and I cannot set specific port.

I have checked my local pc's IPv4 ip and put it on

sudo ufw allow from 192.168.1.2 ip to any port 3306

and

GRANT ALL PRIVILEGES ON . TO 'root'@'192.168.1.2' WITH GRANT OPTION;

But it does not work and it says it is not my ip. I just checked my network ip and I see something like 192.168.1.2 but it does not work. What kind of ip should I write to these configs and where can I find this ip ?


Solution

192.168.1.2 is your internal address on your local network, you must find out your computer's external address



Answered By - Danil Apsadikov
Answer Checked By - Senaida (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing