MySQL allow remote connection (For root and other users)
For all Ensure firewall allows 3306 port: sudo ufw allow 3306 Allow MySQL to bind to all ports: sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf Then set bind-address to 0.0.0.0. bind-address = 0.0.0.0 For root user Log in root locally first: mysql -u root -p Replace the host value. mysql GRANT ALL PRIVILEGES ON . TO 'root'@'%' IDENTIFIED BY 'password'; mysql UPDATE mysql.user SET host='%' …