Initial setup of RDS

#1. RDS Setup for VPC Private Network

To set up RDS and assign it to a VPC, it is essential to correctly select the VPC during the RDS setup, and having the automatically created rds-ec2-x and ec2-rds-x well-assigned prevents most problems.

Optionally, during this process, set up the IAM role and permissions on EC2, and set up the password and IAM permissions in RDS. It still runs without pairing these settings, but with this option turned on, you cannot connect even if you use tunneling.

Anyway, you now need to update the user information to use it, but there’s an error.

MariaDB [(none)]> GRANT ALL PRIVILEGES on <em>.</em> TO 'admin'@'%';
ERROR 1045 (28000): Access denied for user 'admin'@'%' (using password: YES)

Codes based on MySQL standards did not work, possibly due to it being MariaDB.

Creating a custom group with changed options in the Parameter groups and assigning it to the DB also did not work.

1. Create a Parameter group

2. Place to change settings in RDS Modify

3. Check if the settings are reflected; if not, force a reboot go-go

    #2. Solving Permission Issues

    The final command that worked was taken from here. It’s a command.

    GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, PROCESS, REFERENCES, INDEX, ALTER, SHOW DATABASES, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON <em>.</em> TO 'your id'@'%' WITH GRANT OPTION; FLUSH PRIVILEGES;

    #3. Password Reset

    1. Connect to Mariadb
    mariadb -h your RDS address -P 3306 --user=root --password=your password
    1. Reset password
    ALTER USER 'your id'@'%' IDENTIFIED BY 'your new password'; FLUSH PRIVILEGES;

    #4. Removing MariaDB from Linux

    sudo apt list | grep mariadb sudo apt-get purge mariadb-server mariadb-client mariadb-common sudo apt-get autoremove sudo apt-get autoclean

    End

    Blog for the full process: /aws-ec2-mariadb-setup