Connecting to AWS RDS from MySQL Workbench and MATLAB Database Explorer
You can easily connect to databases hosted on cloud services like AWS or GCP using tools such as MySQL Workbench or the Database Explorer in MATLAB. Below are the steps specifically for AWS RDS:
Step 1: Create RDS on AWS
1. Create an RDS Instance:
- Ensure that the instance is publicly accessible by selecting the appropriate radio button during setup.
- Take note of the username and password you choose during this process.
2. Retrieve Connection Details:
- Once the RDS instance is created, navigate to the "Connectivity and Security" tab.
- Copy the endpoint and port number.
3. Configure Security:
- To make the instance publicly accessible, add an inbound rule in the VPC security group associated with your RDS instance.
- You can configure this rule to accept all traffic from any IPv4 address or customize it according to your requirements.
Step 2: Connect Using MySQL Workbench
1. Open MySQL Workbench:
- Set up a new connection.
- Enter the copied endpoint in the "Hostname" field and the port number in the "Port" field.
- Input the username and password you noted earlier.
2. Test and Save Connection:
- Test the connection to ensure everything is set up correctly.
- Save the connection details for future use.
3. Access the Database:
- Log in to the instance and create database instances and tables as needed.
Step 3: Connect Using MATLAB Database Explorer
1. Configure Data Source:
- Click on "Configure Data Source" and then "Configure JDBC Data Source."
- Select the JDBC driver file you have downloaded and added to the MATLAB search path. The file path will typically look something like this - "C:\DRIVERS\mysql-connector-j-9.1.0\mysql-connector-j-9.1.0.jar".
2. Enter Connection Details:
- Enter the endpoint in the "Server" field and the port number in the "Port Number" field.
3. Test and Save Connection:
- Test the connection to verify the setup.
- Save the configuration for future use.
4. Access the Database:
- Connect to the database instance to view tables and data within MATLAB.
Additional Information: JDBC Driver
- The Database Toolbox in MATLAB connects to any relational database that is ODBC-compliant or JDBC-compliant using ANSI SQL.
- To connect using the Database Toolbox, ensure that the database-specific ODBC or JDBC driver is installed on your computer.
- You can download the appropriate driver depending on your database engine by checking this link.
Hope this helps!