Updating EC2 security groups
By default EC2 instances don't allow traffic on port 3306, which is used by MySQL. So we need to add an exception to the inbound traffic rules:Granting remote access in the MySQL security settings
First log in to MySQL as root:mysql -u root -p
We can run this query to grant remote access to all tables in the database:
grant all on *.* to root identified by 'pw';
flush privileges;
exit