Enable access to MySQL/MariaDB from any host in Linux

Commands:

  • sudo nano /etc/mysql/my.cnf
  • Look for [mysqld] and bind-address
  • Edit the new address that matches your desired ip address (0.0.0.0 for all)
  • sudo service mysql restart
  • mysql –uremoteuser -premoteuserpassword
  • GRANT ALL ON *.* TO remoteuser@’%’ IDENTIFIED BY ‘remoteuserpassword’;
  • FLUSH PRIVILEGES;

Source: