Run mysql in jupyter notebook

MySQL is one of the most popular open source relational databases. In this article we will explore how to connect to a MySQL database from a Python notebook and perform data access operations.

We will use the MySQLdb, which is a thread-compatible interface to MySQL that provides the Python database API. This package is pre-installed in your Workbench. Open the Jupyter notebooks on your Data Scientist Workbench and choose Python in the top right corner. Create a new cell, enter the following cell and execute it [Ctrl+Enter].

import MySQLdb
Next, enter your database credentials.
#Enter the values for you database connection
dsn_database = "Enter Database name"  # e.g. "MySQLdbtest"
dsn_hostname = "

Bài mới nhất

Chủ Đề