0

I try to replace SQLite by MariaDB on Jupyter Hub. In the Jupyter Hub configuration file I changed:

#c.JupyterHub.db_url = 'sqlite:///jupyterhub.sqlite'

by

c.JupyterHub.db_url = 'mysql+pymysql://{}:{}@{}/{}{}'.format("username","pwd","localhost","jupyterhub","")

I've created an empty database "jupyterhub" with PhpMyAdmin, but when I launch Jupyter Hub, I have the following error message :

Failed to connect to db: mysql+pymysql://username:pwd@localhost/jupyterhub

"Username" and "pwd" are good, they work with PhpMyAmdin.

I've tried several things but no luck. Any idea ?

Peter Estiven
  • 414
  • 1
  • 7
  • 16

1 Answers1

1
  1. Install mysql-connector

    pip3 install 'mysql-connector<2.2'
    
  2. In Jupyter Hub config file:

    c.JupyterHub.db_url = 'mysql+mysqlconnector://{}:{}@{}/{}{}'.format("username","pwd","127.0.0.1","jupyterhub","")
    
  3. In MariaDB config file if version < 10.2.1

    [mysqld]
    innodb_file_format=Barracuda
    innodb_large_prefix=1