Using MySQL or Microsoft SQL Server to store user authentication

Hello Jupyter Team,

I am looking for setting up Jupyter Lab for my internal services. It is currently using “jupyterhub.sqlite” to store user accounts, instead of my SQL Servers (e.g., MySQL and Microsoft SQL Server)

Is there any chance to switch from “jupyterhub.sqlite” to store data in the SQL Server?

Platform
OS: Ubuntu 20.04 LTS (WSL) on Windows Server 2022 Datacenter (OS Build 20348.1607)
WSL Version: 1 (I cannot upgrade to WSL2 because of the compatibility)

I won’t accept any answer that “jupyterhub.sqlite” is good enough to not switch to SQL Server. Thanks for all.

Yes, JupyterHub uses sqlalchemy, which means you can use several database backends, sqlite is only the default because it’s always available and requires no setup. postgres and mysql are fully tested and well supported, but other backends may work as well.

For example, to use mysql with pymysql:

c.JupyterHub.db_url = "mysql+pymysql://<username>:<password>@<host>/<dbname>[?<options>]"

password can also be specified via $MYSQL_PWD env.

JupyterHub database documentation

1 Like