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:
We log in to Qubinets and go through the new cloud setup.
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.
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.
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.
For deployment purposes, we set these connection details as environment variables.
We wrote SQL queries to create a table named “customers” and insert a new customer record into this table.
After deploying our applications, we retrieved the external address of the Ingress Nginx and used it to run our Python script.
We opened DBeaver, which prompted us to set up the connection using our MySQL host, username, and password.
We confirmed that the “customers” table existed and the inserted data was present.
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.
The above is the detailed content of Creating cloud, provisioning database and dbeaver and connect it to code quickly. For more information, please follow other related articles on the PHP Chinese website!