I am running 2 Raspberry Pi3 (STRETCH, JESSIE) and a web server (PHP5, MySQL, PHPMyadmin, Apache2) on stretch. I have everything working as expected. However, I need to be able to connect to my MySQL from a remote machine to store data, but I can't connect at all. I have gone UP and DOWN the Internet looking for answers and solution and have tried them all. Still, I can't connect to the MySQL Database. I did the following after reading through Raspberry Pi forum.
Logged into mysql and executed the following commands
CREATE USER 'myusername'@'%' IDENTIFIED BY 'mypassword';
GRANT ALL PRIVILEGES ON *.* TO 'myusername'@'%' WITH GRANT OPTION;
Then, I logged out of mysql and I modified my.cnf file as follows; Commented out the following line in that file.
sudo nano /etc/mysql/my.cnf and commented out
#bind-address = 0.0.0.0
My remote machine still can't connect to MySQL database.
However, I did notice something. On the pi that is running the webserver, my program running on it can connect using the ip address of the machine instead of localhost after doing the above steps before it would only connect using localhost. So I naturally assumed that now my program should be able to connect to mysql database from any other devices on the network, but it is not the case.
So, what am I doing wrong.