MySQL Cloud Database Setup Guide

The steps to use MySQL cloud database are as follows:

  1. To create a MySQL instance, log in to the cloud database console, click on “Create Instance” on the instance list page, select the MySQL database engine, instance specifications, storage space size, and other parameters, then click on the “Buy Now” button to complete the creation.
  2. Connect to the database: Navigate to the instance list page to locate the created MySQL instance, click on the instance name to access the instance details page, and find the connection address, port number, username, and password in the connection information. Use a MySQL client tool (such as Navicat, MySQL Workbench, etc.) to connect to the database.
  3. Creating databases and tables: Once connected to the database using the MySQL client tool, you can use SQL statements to create databases and tables. For example:
  4. Establish a database called testdb. Switch to using testdb. Establish a table named test_table with columns id (integer, primary key) and name (varchar, max 50 characters).
  5. Inserting data: Use the INSERT statement to add data to a table, for example:
  6. Add the following data to the test_table:
    1. id: 1, name: ‘Alice’
    2. id: 2, name: ‘Bob’
  7. To search for data: Utilize the SELECT statement to retrieve data, for example:
  8. Choose all columns from the table named test_table.
  9. Updating and deleting data: Use UPDATE and DELETE statements to modify or delete data, for example:
  10. Update the name to ‘Charlie’ in the test_table where id is 2. Then, delete the row with id 1 from the test_table.
  11. Disconnect: Remember to disconnect after using the database to release resources and prevent performance degradation from having too many database connections.
bannerAds