I am aware of this command:
GRANT ALL PRIVILEGES
ON database.*
TO \'user\'@\'yourremotehost\'
IDENTIFIED BY \'newpassword\';
But then it on
You can slove the problem of MariaDB via this command:
GRANT ALL ON *.* to root@'%' IDENTIFIED BY 'mysql root password';
%
is a wildcard. In this case, it refers to all IP addresses.
Just create the user to some database like
GRANT ALL PRIVILEGES ON <database_name>.* TO '<username>'@'%' IDENTIFIED BY '<password>'
Then go to
sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf
and change the line bind-address = 127.0.0.1
to bind-address = 0.0.0.0
After that you may connect to that database from any IP.
You can disable all security by editing /etc/my.cnf:
skip-grant-tables