AWS MySQL
Sleakops enables effortless utilization of MySQL databases through Amazon RDS. This managed database service provides a reliable and scalable data storage solution, allowing your applications to handle varying workloads with ease. By leveraging Sleakops for this integration, you can streamline the setup and management of MySQL databases in your EKS environment.
You can read more about those benefits in this link .
Values and credentials for the next sections should be retrieved from Sleakops console on the edition page of the vargroups corresponding to the Dependency.
How to create a dump for MySQL
There are multiple ways to create a dump for a MySQL database. Simplest one is to create a dump from the server with the following command:
mysqldump -h MYSQL_ADDRESS -u MYSQL_USERNAME -p MYSQL_PASSWORD > dump.sql
For more information on how to create a dump read the official documentation.
How to import a database dump to RDS
- Connect to the VPN of the account where the RDS is.
- Connect to the database
- Using docker (Recommended)
- Using local machine
A prerequisite to this method is to have the docker installed on your local machine.
- Run a container with the mysql image. The attached volume is the folder with your dump.
docker run -it --name mysql-container -v ./initial_data/:/tmp/data/ -e MYSQL_ROOT_PASSWORD=MYSQL_PASSWORD -d mysql bash
- Attach to the terminal to run the mysql command
docker exec -t -i mysql-container bash
- Run the following command:
mysql -h MYSQL_ADDRESS -u MYSQL_USERNAME -p < /tmp/data/dump.sql
A prerequisite to this method is to have MySQL installed on your local machine.
- Simply run the following command:
mysql -h MYSQL_ADDRESS -u MYSQL_USERNAME -p MYSQL_PASSWORD < /tmp/data/dump.sql