How to grant privileges in MySQL

grant all on Database.* to 'User'@'Host';
grant alter, alter routine, create, create routine, create temporary tables, create view, delete, drop, event, execute, index, insert, lock tables, references, select, show view, trigger, update on Database.* to 'User'@'Host';

How to allow remote access to MySQL on Ubuntu

sudo sed -i.bak -e '0,/127.0.0.1/s//0.0.0.0/' /etc/mysql/mysql.conf.d/mysqld.cnf
sudo systemctl restart mysql
update mysql.user set host='%' where user='User';
sudo ufw allow mysql && sudo ufw reload && sudo ufw status
mysql --host=Host --user=User --password=Password