I've hosted my laravel app on a digitalocean droplet (Ngnix Ubuntu) . Everything from this side is working well.
I need to test remote access to mysql.
First, from the Droplet's side, I've granted access to mysql by any Ip address by this command:
sudo ufw allow 3306
To test the remote access, I've tried to connect a localhost laravel app to the droplet's mysql database .
DB_HOST= here I've put the Ip address of the droplet.
DB_PORT=3306
DB_DATABASE=dbname
DB_USERNAME=dbuser
DB_PASSWORD=dbpass
- It gives this error :
SQLSTATE[HY000] [2006] MySQL server has gone away (SQL: select * from 'users' where 'username' = admin limit 1)
I tried to search a lot.. tried some suggestions.. still no solution.
EDIT: This is my.cnf file in /etc/mysql ..
Thanks in advance!