Photo by Claudio Schwarz on Unsplash
Initial database and create user for service on Aurora MySQL 8
AWS/RDS
outline
After creating MySQL server or AWS RDS, you need to make or initial database and create user and password for service.
basic-query-for-initialization
# create user for service
CREATE USER '<SRV-USER>'@'<VPC-IP-RANGE>' IDENTIFIED BY '<SRV-USER-PASSWORD>' PASSWORD EXPIRE NEVER;
# grant to service user
GRANT ALL ON <SRV-DATABASE>.* TO '<SRV-USER>'@'<VPC-IP-RANGE>';
# apply
flush privileges;
# create database for service
CREATE DATABASE `<SRV-DATABASE>` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */;