pip install jupysql
.
You can consider an option to interact with MindsDB directly from MySQL CLI or Postgres CLI.
How to Connect
Pre-requisite:
- Make sure you have jupysql installed: To install it, run
pip install jupysql
- Make sure you have pymysql installed: To install it, run
pip install pymysql
You can easily verify the installation of jupysql by running this code:This command loads the package and allows you to run cell magics on top of Jupyter.And for pymysql, validate by running this command:
You can use the Python code below to connect your Jupyter notebook (or lab) to Local MindsDB database (via Jupysql).
Load the extension:Connect to your DB:Testing connection by listing the existing tables (pure SQL):Please note that we use the following connection details:
- Username is
mindsdb
- Password is left empty
- Host is
127.0.0.1
- Port is
47335
- Database name is
mindsdb