I have two dropplets at digitalocean, one is for http server and another is for database.
In mysql config
/etc/mysql/mysql.conf.d/mysqld.cnf I have set
bind-address to digitalocean private ip and everithing was working without the errors.
After server was rebooted, mysql failed to start. After I change
127.0.0.1 it was working again, but my php app could not connect to the database.
Just to be clear, this kind of set up was working fine atfer server reboot.