$ sudo apt-get update
$ sudo apt-get install mysql-server
Mysql will ask for root password
$ mysql -u root -p
Will ask for root password
$ mysql> GRANT ALL PRIVILEGES ON DBNAME.* TO 'USERNAME'@'%' IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;
Check grants
$ mysql> SELECT * from information_schema.user_privileges where grantee like "'USERNAME'%";
-
$ mysql> FLUSH PRIVILEGES;
-
Comment this line
#bind-address = 127.0.0.1
from file /etc/mysql/mysql.conf.d/mysqld.cnf ORsudo vi /etc/mysql/conf.d/mysql.cnf
and addbind-address = 0.0.0.0
-
$ ~ /etc/init.d/mysql restart