Create additional user in MySQL - Sentto/Sentto-University GitHub Wiki
Connect to RDS instance using your master user and run the following command:
- Run the command below to create an additional user and specify it password:
mysql> CREATE USER 'username'@'%' IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.02 sec)
```
- Run the command below to allow the created user to query and modify data on the specified database: (replace DB_NAME with your database)
mysql> GRANT select, insert, update, delete, execute, show view, create temporary tables ON DB_NAME.* TO 'username'@'%'; Query OK, 0 rows affected (0.01 sec)
```
- Run the command below to allow the created user to create, modify and drop tables on the specified database: (replace DB_NAME with your database)
mysql> GRANT create, alter, references, index, drop, trigger on DB_NAME.* to 'username'@'%'; Query OK, 0 rows affected (0.02 sec) ```
- Run the command below to allow the created user to create views and routines on the specified database: (replace DB_NAME with your database)
mysql> GRANT create view, create routine, alter routine on DB_NAME.* to 'username'@'%'; Query OK, 0 rows affected (0.01 sec) ```
- After running the commands to create the user and adjust the privileges, run the command below to enforce the privileges immediately:
FLUSH PRIVILEGES;
For detailed information on what each permission allow the user to do, please check the MySQL documentation: http://dev.mysql.com/doc/refman/5.6/en/grant.html#grant-privileges