I've tried to look for a solution and there are many similar questions but somehow none of the solutions are working.
I have a laravel app running on one of my ubuntu servers at 1.2.3.4 IP. I installed mysql and everything is working fine for the app on the same server as the database.
Now, I want to access the database on 1.2.3.4 from another server with a.b.c.d IP.
https://www.digitalocean.com/community/tutorials/how-to-allow-remote-access-to-mysql
I followed the instructions given in the above link.
- I changed bind_address to 0.0.0.0 in my conf file.
- Created a user
CREATE USER 'test_user'@'a.b.c.d' IDENTIFIED BY 'password';
- Assigned appropriate permissions and
FLUSH PRIVILEGES;
- Open access on 3306.
On
ufw status
, I'm getting this response for 3306 IP:
3306 ALLOW Anywhere
3306/tcp ALLOW Anywhere
But when I try to access the database mysql -u test_user -h 1.2.3.4 -p
I'm getting ERROR 2003 (HY000): Can't connect to MySQL server on '1.2.3.4' (10060)
Maybe I'm missing some step(s) or not using IP addresses correctly. Can anyone please assist? Any way to identify the actual issue behind the error?