AWS MySql – How to create Read-Only user?

If you want to create a user for connecting to a AWS MySQL instance, one of the options is to use a MySQL client (eg. HeidiSQL). Log in as an administrator, an after that, type the following command:

  • To give access from any host:
    grant select on database_name.* to 'your_mysql_username'@'%' identified by 'your_mysql_password';
  • To give access on the same host as database:
    grant select on database_name.* to 'your_mysql_username' identified by 'your_mysql_password';

Pay attention that the Security Group attached to the MySQL instance, has to be configured to allow inbound TCP, port 3306, with source 0.0.0.0/0 if you want to access the database from anywhere.

AWS Security Group for MySQL

AWS Security Group for MySQL

Leave a Reply