DEV Community

Cover image for Creating cloud, provisioning database and dbeaver and connect it to code quickly
Nix
Nix

Posted on

Creating cloud, provisioning database and dbeaver and connect it to code quickly

https://youtu.be/7EfYn7MkdyI?si=mRekrHtNc7pjO8Gb

In the video above, I'm showcasing how to create cloud, provision MySQL database and dbeaver and then how I connect all of it to my code quickly.

Here's a more detailed explanation:

  1. We log in to Qubinets and go through the new cloud setup.

  2. We pick from the set of application we are going to use (in our case MySQL). We also added DBeaver for database management and Ingress Nginx for connectivity to our MySQL instance.

  3. We chose our preferred cloud provider and completed the setup by clicking on “Instantiate Cloud.” Once the cloud setup was complete, we connected our applications. We changed the database name to “Qubinets” and updated this in the connection settings in DBeaver. Ensured the port for the MySQL connection was set to 3306.

  4. In our IDE, we wrote a Python script to connect to the MySQL database. We used the connection details (username, password, database name, and host) within our script.

  5. For deployment purposes, we set these connection details as environment variables.

  6. We wrote SQL queries to create a table named “customers” and insert a new customer record into this table.

  7. After deploying our applications, we retrieved the external address of the Ingress Nginx and used it to run our Python script.

  8. We opened DBeaver, which prompted us to set up the connection using our MySQL host, username, and password.

  9. We confirmed that the “customers” table existed and the inserted data was present.

  10. To ensure persistence, we added another customer record and verified it in DBeaver.

In summary, we created a cloud, provisioned MySQL and DBeaver, connected them with Ingress Nginx, wrote and ran a Python script to interact with the database, and verified everything in DBeaver—all in 30 minutes. All of this was done with the help of Qubinets.

Top comments (0)