Description

The get_database() and create_database() functions enable you to use the existing data source or connect a new one.

Syntax

You can use the get_database() method to get an existing database:

mysql_demo_db = server.get_database('mysql_demo_db')

Or, the create_database() method to connect a new data source to MindsDB:

mysql_demo_db = server.create_database(
    engine = "mysql",
    name = "mysql_demo_db",
    connection_args = {
      "user": "user",
      "password": "MindsDBUser123!",
      "host": "samples.mindsdb.com",
      "port": "3306",
      "database": "public"
    }
)