Mariadb_kernel not working with TLJH

i want to use the mariadb_kernel in TLJH, but i cannot get i to work.

My setting:
Ubuntu 20.04 on a Virtual Server

I use the TLJH suggested Install Method
sudo apt install python3 python3-dev git curl
curl -L https://tljh.jupyter.org/bootstrap.py | sudo -E python3 - --admin myjupyteradmin

and then i enabled https as suggested here Enable HTTPS in TLJH

Then installed as suggested in a jupyter terminal:

sudo -E conda install -c conda-forge gdal sudo -E pip install there

Then i installed mariadb-server on the Ubuntu Server
and run the security script

sudo mysql_secure_installation

Then i logged in as admin in jupyterhub, started a terminal and installed there:
python3 -m pip install mariadb_kernel
python3 -m mariadb_kernel.install

When i then log in as admin in jupyterhub an start a new notbook i can choose MariaDB as a notebook.

But it does not start:

Connection failed

A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.

What am i doing wrong?

Is the Ubuntu 20.04 the Problem?
Where to look?

Can anyone get me back on the track?

Thanks

F.E.

Have you successfully used the mariadb kernel before without JupyterHub, i.e. by running JupyterLab/notebook locally?

Hi,
i just tried it locally. And that helped. Unfortunatly not for new users…

It turns out that on a local machine jupyter is a lot more verbose and more clear to me.

I found out that jupyter could not connect to mariadb because of wrong login data.

I do not know if it is the right way but here is what i did:

Created an other mariadb user with admin rights.

Created on the sever (and at home)

/home/jupyter-/.jupyter/mariadb_config.json

with the new credentials as stated here:

But now i have a new issue. When i create a new user “test” it does not work:

sudo journalctl -u jupyter-test

gives me some errors:

[…]

Oct 22 10:02:13 myserver bash[643]: /opt/tljh/user/lib/python3.9/json/encoder.py:257: UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default.
Oct 22 10:02:13 myserver bash[643]:   return _iterencode(o, 0)
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:07.515 SingleUserNotebookApp log:189] 200 GET /user/test/api/contents?type=directory&_=1634889727290 (test'at'myserver) 1.67ms
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:09.523 SingleUserNotebookApp handlers:153] Creating new notebook in
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:09.531 SingleUserNotebookApp sign:399] Writing notebook-signing key to /home/jupyter-test/.local/share/jupyter/notebook_secret
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:09.535 SingleUserNotebookApp log:189] 201 POST /user/test/api/contents (test'at'myserver) 12.15ms
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:09.894 SingleUserNotebookApp log:189] 200 GET /user/test/notebooks/Untitled.ipynb?kernel_name=mariadb_kernel (test'at'myserver) 333.29ms
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:11.036 SingleUserNotebookApp log:189] 200 GET /user/test/api/config/notebook?_=1634889730919 (test'at'myserver) 2.53ms
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:11.038 SingleUserNotebookApp log:189] 200 GET /user/test/api/config/common?_=1634889730920 (test'at'myserver) 1.59ms
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:11.097 SingleUserNotebookApp log:189] 200 GET /user/test/api/contents/Untitled.ipynb?type=notebook&_=1634889730921 (test'at'myserver) 3.78ms
Oct 22 10:02:13 myserver bash[643]: Exception in callback <TaskWakeupMethWrapper object at 0x7f4c36c5aa90>(<Future finis...9726\r\n\r\n'>)
Oct 22 10:02:13 myserver bash[643]: handle: <Handle <TaskWakeupMethWrapper object at 0x7f4c36c5aa90>(<Future finis...9726\r\n\r\n'>)>
Oct 22 10:02:13 myserver bash[643]: Traceback (most recent call last):
Oct 22 10:02:13 myserver bash[643]:   File "/opt/tljh/user/lib/python3.9/asyncio/events.py", line 80, in _run
Oct 22 10:02:13 myserver bash[643]:     self._context.run(self._callback, *self._args)
Oct 22 10:02:13 myserver bash[643]: RuntimeError: Cannot enter into task <Task pending name='Task-8' coro=<HTTP1ServerConnection._server_request_loop() running at /opt/tljh/user/lib/python3.9/site-packages/tornado/http1connection.py:823> wait_for=<F>
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:11.197 SingleUserNotebookApp kernelmanager:179] Kernel started: 9336b820-3d65-4289-b01e-9d5009092625, name: mariadb_kernel
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:11.198 SingleUserNotebookApp log:189] 201 POST /user/test/api/sessions (test'at'myserver) 24.80ms
Oct 22 10:02:13 myserver bash[649]: /opt/tljh/user/bin/python3: No module named mariadb_kernel
Oct 22 10:02:13 myserver bash[643]: [I 2021-10-22 10:02:11.217 SingleUserNotebookApp log:189] 200 GET /user/test/api/metrics/v1 (test'at'myserver) 1.76ms
Oct 22 10:02:14 myserver bash[643]: [I 2021-10-22 10:02:14.196 SingleUserNotebookApp restarter:120] KernelRestarter: restarting kernel (1/5), new random ports
Oct 22 10:02:14 myserver bash[652]: /opt/tljh/user/bin/python3: No module named mariadb_kernel
Oct 22 10:02:16 myserver bash[643]: [I 2021-10-22 10:02:16.219 SingleUserNotebookApp log:189] 200 GET /user/test/api/metrics/v1 (test'at'myserver) 2.21ms
Oct 22 10:02:17 myserver bash[643]: [I 2021-10-22 10:02:17.203 SingleUserNotebookApp restarter:120] KernelRestarter: restarting kernel (2/5), new random ports
Oct 22 10:02:17 myserver bash[653]: /opt/tljh/user/bin/python3: No module named mariadb_kernel
Oct 22 10:02:20 myserver bash[643]: [I 2021-10-22 10:02:20.209 SingleUserNotebookApp restarter:120] KernelRestarter: restarting kernel (3/5), new random ports
Oct 22 10:02:20 myserver bash[654]: /opt/tljh/user/bin/python3: No module named mariadb_kernel
Oct 22 10:02:23 myserver bash[643]: [I 2021-10-22 10:02:23.217 SingleUserNotebookApp restarter:120] KernelRestarter: restarting kernel (4/5), new random ports
Oct 22 10:02:23 myserver bash[660]: /opt/tljh/user/bin/python3: No module named mariadb_kernel
Oct 22 10:02:26 myserver bash[643]: [W 2021-10-22 10:02:26.230 SingleUserNotebookApp restarter:113] KernelRestarter: restart failed
Oct 22 10:02:27 myserver bash[643]: [W 2021-10-22 10:02:26.230 SingleUserNotebookApp kernelmanager:146] Kernel 9336b820-3d65-4289-b01e-9d5009092625 died, removing from map.
Oct 22 10:02:57 myserver bash[643]: [W 2021-10-22 10:02:57.426 SingleUserNotebookApp web:1787] 404 GET /user/test/api/kernels/9336b820-3d65-4289-b01e-9d5009092625/channels?session_id=b8a9d20b731f42949e76e863e7e19d96 (91.97.127.70): Kernel does not e>
Oct 22 10:02:57 myserver bash[643]: [W 2021-10-22 10:02:57.432 SingleUserNotebookApp log:189] 404 GET /user/test/api/kernels/9336b820-3d65-4289-b01e-9d5009092625/channels?session_id=b8a9d20b731f42949e76e863e7e19d96 (test'at'myserver) 6.83ms
Oct 22 10:02:59 myserver bash[643]: [W 2021-10-22 10:02:59.507 SingleUserNotebookApp handlers:367] Replacing stale connection: 9336b820-3d65-4289-b01e-9d5009092625:b8a9d20b731f42949e76e863e7e19d96
Oct 22 10:03:11 myserver bash[643]: [W 2021-10-22 10:03:11.331 SingleUserNotebookApp handlers:344] Timeout waiting for kernel_info reply from 9336b820-3d65-4289-b01e-9d5009092625
Oct 22 10:03:12 myserver bash[643]: [I 2021-10-22 10:03:11.332 SingleUserNotebookApp log:189] 101 GET /user/test/api/kernels/9336b820-3d65-4289-b01e-9d5009092625/channels?session_id=b8a9d20b731f42949e76e863e7e19d96 (test'at'myserver) 60003.53ms
Oct 22 10:03:12 myserver bash[643]: [E 2021-10-22 10:03:11.332 SingleUserNotebookApp handlers:397] Error opening stream: HTTP 404: Not Found (Kernel does not exist: 9336b820-3d65-4289-b01e-9d5009092625)
Oct 22 10:03:48 myserver bash[643]: [W 2021-10-22 10:03:48.621 SingleUserNotebookApp handlers:367] Replacing stale connection: 9336b820-3d65-4289-b01e-9d5009092625:b8a9d20b731f42949e76e863e7e19d96
Oct 22 10:04:11 myserver bash[643]: /opt/tljh/user/lib/python3.9/json/encoder.py:257: UserWarning: date_default is deprecated since jupyter_client 7.0.0. Use jupyter_client.jsonutil.json_default.
Oct 22 10:04:11 myserver bash[643]:   return _iterencode(o, 0)
Oct 22 10:04:11 myserver bash[643]: [I 2021-10-22 10:04:11.195 SingleUserNotebookApp log:189] 200 GET /user/test/api/contents/Untitled.ipynb?content=0&_=1634889730923 (test'at'myserver) 1.52ms
Oct 22 10:04:11 myserver bash[643]: [I 2021-10-22 10:04:11.220 SingleUserNotebookApp handlers:164] Saving file at /Untitled.ipynb
Oct 22 10:04:11 myserver bash[643]: [I 2021-10-22 10:04:11.230 SingleUserNotebookApp log:189] 200 PUT /user/test/api/contents/Untitled.ipynb (test'at'myserver) 11.31ms
Oct 22 10:04:41 myserver bash[643]: [W 2021-10-22 10:04:41.710 SingleUserNotebookApp handlers:367] Replacing stale connection: 9336b820-3d65-4289-b01e-9d5009092625:b8a9d20b731f42949e76e863e7e19d96
Oct 22 10:05:42 myserver bash[643]: [W 2021-10-22 10:05:42.822 SingleUserNotebookApp handlers:367] Replacing stale connection: 9336b820-3d65-4289-b01e-9d5009092625:b8a9d20b731f42949e76e863e7e19d96
Oct 22 10:06:59 myserver bash[643]: [W 2021-10-22 10:06:59.935 SingleUserNotebookApp handlers:367] Replacing stale connection: 9336b820-3d65-4289-b01e-9d5009092625:b8a9d20b731f42949e76e863e7e19d96
Oct 22 10:07:57 myserver bash[643]: [I 2021-10-22 10:07:56.225 SingleUserNotebookApp log:189] 200 GET /user/test/api/metrics/v1 (test'at'myserver) 4.26ms

Hi @ehs! Did you manage to make mariadb_kernel work? I came across your post randomly today, so I’m very sorry this reply comes so late. Let me know if I can help you get your setup up and running. TLJH JupyterHub with MariaDB notebooks should definitely be something that should work, I even had a presentation demo at some point on a setup like this, but if you’ve hit a bug, I’d love if we could fix it together.

Hi robertbindar,

i did not manage to get mariadb_kernel to work.
I reinstalled my server (i had a snapshot :wink: ) tljh and the python kernel works.

I will follow this instructions, or do you think another way might be better? I tried this 3 times from fresh install:

Fixing this would be nice because i could use it in class when the lockdown will come in december (Germany).

Hi there, hi@robertbindar,

i repeated the installation and now it seems to work for the admin account which is new:

What i did:

Installed tljh as recommended here:

https://tljh.jupyter.org/en/latest/install/custom-server.html

Installed MariaDB on the Server via ssh

sudo apt install mariadb-server
sudo mysql_secure_installation

→ with no root passwort for mysql

In Jupyterhub using the terminal in the juypter admin account

python3 -m pip install mariadb_kernel

There i got some warnings:

  WARNING: The script tabulate is installed in '/home/jupyter-jupyteradmin/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script sqlformat is installed in '/home/jupyter-jupyteradmin/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The scripts f2py, f2py3 and f2py3.9 are installed in '/home/jupyter-jupyteradmin/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
  WARNING: The script mycli is installed in '/home/jupyter-jupyteradmin/.local/bin'which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

so i tried

sudo python3 -m pip install mariadb_kernel

and i get this

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

I choose to ignore this warning.

python3 -m mariadb_kernel.install

Then i logged out from my jupyter admin account and logged back in. Now the mariadb kernel is available and seems to work.

Unfortunately this only applies to the admin account. Newly created users do not have the mariadb kernel.

Seems like i am close to the finish line… :wink: But i have no clue what i have to do now.
Where to look?

Hi again @ehs. Managed to find the presentation (here’s the link Robert Bindar - MariaDB Foundation - MariaDB Notebooks in JupyterHub - Percona Live 2021 - YouTube ). The demo there is based on installing tljh jupyterhub on digitalocean, but it shouldn’t be much of a difference for you once you already set up your custom installation and Python kernel is working.

In the presentation you will see a number of setup examples for making the system work, min 4:28 (e.g each jupyter user accesses their own MariaDB server process, all users acces the same MariaDB server but each one has acces to its own database, etc).
I chose to demo there the first version in which every jupyter user has its own spinning MariaDB server, I thought that’s a good solution for deploying the whole thing in a SQL university class. Any other option would work, it depends whether you like more jupyter configuration and scripts (min 14:27) or you like more database configuration for creating users and so on.

I hope the video will help you get some more insight into how the whole thing works. Here’s what I think (with the info I have right now) might have gone wrong with your setup:

  1. You probably want ‘sudo -E’ and you want it for both ‘pip install’ and ‘mariadb_kernel.install’. I don’t fully understand how JupyterHub manages the conda environments underneath its users, but I’m guessing ‘sudo -E’ should play it safer (you will get rid of the warning as well most probably). Not having this might explain why the admin user sees the mariadb_kernel package, but the others don’t.

  2. Getting the setup work is mostly about the configuration:

  • TLJH AFAIK creates one unix user account for each jupyter user. These unix users underneath share the same conda environment (thus python packages are shared), but they’re still different unix users so each has its own home directory, different $HOME env vars, and so on.

  • If you want all your students to acces the same MariaDB server instance via the same database account (e.g. root@localhost), you need only one ‘mariadb_config.json’ (you just need to make sure the json file sits at $JUPYTER_CONFIG_DIR and that this env var is defined, that’s where the kernel looks for it the first time).
    You start your MariaDB server instance. Create mariadb_config.json to point to that instance. Each
    Jupyter user (student) for each notebook creates a kernel that connects to MariaDB. It’s very simple
    but you get zero differentiation in terms of data/permissions on the database between users.

  • For all the other cases you need one different ‘mariadb_config.json’ for each Jupyter user. This way, every set of kernels that users create knows to which MariaDB server or MariaDB user account to connect.
    For this scenario, please see video at min 14:27 where there is a bash script that generates everything needed for each Jupyter user. If you choose to go this way, I can help you with the bash script.

BTW, it’s awesome to see you moving your SQL/databases/datascience class to Jupyter and MariaDB, I helped some other people set up something similar. Do you mind sharing what university you’re doing this work for?

1 Like

hi @robertbindar ,

your solution in the video is exactly what i am looking for. Thanks a lot for helping me.

I had some problems with my server (tried to much and couldnt reverse some things…), so i set it up again. Sorry for the delay.

When it comes to mariadb_kernel i tried this in a terminal from jupyterhub:


sudo -E python3 -m pip install mariadb_kernel

and i got these warnings:

WARNING: The directory '/home/jupyter-jupyteradmin/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, youshould use sudo's -H flag.

WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

so i did, as the -H option is recommended i the warning.


sudo -E -H python3 -m pip install mariadb_kernel

and i only got one warning left:


WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

And then finally

sudo -E -H python3 -m mariadb_kernel.install

Then i got what you called the “wildwest szenario”. :wink: I can create users and they all use the same mariadb with unlimited access. Which is super as i never got that far until now.

But what I need is the scenario you described in your video.

Unfortunately it does not work for me.

I used your script (and learned a lot about scripting, therefore i tipped it manually) and had to change some things and i added some echos in order to find out where things went wrong.

I wonder if the “sudo -u” thing in the script is working correct in my case, because the dirs and the files are owned by root, after i run the script. I would have expected that the owner is the user $username

I changed the owner to the correct user with chown, but it had no effect.

jupyterhup gives the following after a while:

#### Connection failed

A connection to the notebook server could not be established. The notebook will continue trying to reconnect. Check your network connection or notebook server configuration.

Now i am stuck again. Close to the finish line.

Here is my last version of your script, which runs with no errors:

#!/bin/bash
# Script from Robert Bindar https://www.youtube.com/watch?v=lnrn9eDYR7Y
#some minor changes from F. Ehlers


port=3306

for dir in /home/*;
do
    echo "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    #generate username from home directory
    username=`echo $dir | cut -d'/' -f3`
    echo "Working on user $username"

    #print current dir
    echo $dir

    #delete old dirs
    #I am not sure why this is needed, because the datadir is deleted as well
    rm -rf $dir/datadir $dir/.my.cnf $dir/.jupyter/mariadb_config.json
    echo "Delete old dirs"

     #create new dirs for user
    sudo -u $username mkdir $dir/datadir $dir/.jupyter &>/dev/null
    echo "Create new dirs"

    #install mariadb for each user 
    #mariadb-install-db from version 10.4 i have 10.3 until then mysql_install_db
    #Please notice the diffrence between - and _ 

    sudo -u $username mysql_install_db --user=$username --datadir=$dir/datadir --auth-root-authentication-method=normal &>/dev/null
    echo "Installed database"

    #create .my.cnf
    sudo -u $username echo "
    [client-server]
    socket=$dir/mariadb_dbg.socket
    port=$port

    [mariabdb]
    max-connections=20
    datadir=$dir/datadir" > $dir/.my.cnf
    echo "Wrote .my.cnf "


    #mariadb_config.json schreiben
    sudo -u $username echo "
    {
            \"user\": \"root\",
            \"host\": \"localhost\",
            \"port\": \"$port\",
            \"password\": \"\",
            \"start_server\": \"True\",
            \"client_bin\": \"mariadb\",
            \"server_bin\": \"mariadbd\"
    }" > $dir/.jupyter/mariadb_config.json
    echo "wrote json "
    
    # add 1 to the portnumber for the next user, brackets are necessary
    port=$((port+1))

done

You asked if i mind sharing my goal:

I work as a teacher in a vocational school (Berufsbildende Schule) in germany. The subject is computer science at the vocational high school (Berufliches Gymnasium). The students are in their 13th and around 18 years of age.
I don’t have the option to install the necessary software, because our IT support is not able to do this and they don’t want to either. Thats what we call “Digitalisierung” around here. It is frustrating.
So I thought “jupyter notebooks” might be the solution.
I am currently working with instahub.org to teach databases. This is a great tool. The students learn how databases work on a very nice social network. And it is completly in the net.

I wanted to use jupyter to deepen this topic and maybe get into python in the next half year. Exams could perhaps also be handled very cleverly with nbgrader.
And it would be something that the “big boys” at university also use.

I am realy looking forward to get this to work.

Hey @ehs! Thanks for showing real courage tackle this yourself! Let me try to reproduce TLJH and mariadb_kernel installation from scratch on a bare metal server, some things changed in mariadb_kernel in the meantime since the video was released. I want to make sure everything is working smoothly. I’ll get back to your answer once I complete the setup myself and hopefully I can provide you with a bash script to make everything work seamlessly and not have you spend anymore time on debugging stuff.

1 Like

Hi @robertbindar ! thats sounds amazing to me. Thank you for working on this.
I just found out that i have an error in the script where the .my.cnf is created: it has to be:

socket=$dir/mariadb_dbg.sock

not socket at the end.

But now there are more warnings when the mysql_install_db installation part is executed.

I have a snapshot (tljh just installed and working and no mariadb_kernel stuff installed) and can do tests as well, if you have something to test.

@ehs I created a bare metal Ubuntu machine on cloud and tried to replicate your setup.

  • I installed TLJH for custom server as it is described in the documentation, all went well.
  • I install mariadb_server with ‘apt install’
  • ‘apt install’ triggers systemd to start the MariaDB server service. So please run ‘systemctl stop mysqld’ to actually stop the service, you don’t need them and it might cause conflicts.
  • I entered JupyterHub and created a bunch of users.
  • I installed mariadb_kernel with the two sudo -E commands. Warnings here are new, I haven’t seen them before but you can safely ignore them.
  • I went into the machine and ran the script from this github URL.
    Setup script for mariadb_kernel in TLJH ¡ GitHub
  • I started a MariaDB notebook from a couple of jupyter users and everything went ok.
  • Please note that the script is adjusted (it’s not exactly the one I presented in the video). It has some bits removed because functionalities like creating the datadir (mysql_install_db) is actually performed by the jupyter kernel itself, in this new script I just added a bunch of options to instruct the kernel in the right direction.

Let me know how that goes. Please allow some time when you open a MariaDB notebook, it takes a bit till you see the white little circle with “Kernel ready” because installation and startup of server takes a bit. It shouldn’t be more than a few seconds though.

Sorry for overlapping with answers, today is an insane day in terms of schedule and I’m trying in best to be everywhere at the same time.

I’ve actually looked up what a vocational school means in Germany school system, and I’m very impressed, it is actually an opportunity for young people that is lacking a lot in Romania for instance at the moment.
It’s an absolute bliss to help you set up this project for your class, you’re the third person I’m helping setting up something similar, first and second being two universities in sweden and columbia if I remember correctly.

You don have to apologize. I am happy that you have the time and will to help me. I apreciate that. Thanks a lot.

I tried your latest hints. And they all worked with no error.

Unfortunatly it is still “wild west”, because on my server user jupyter-test1 creates a database and user juypter-test2 is able to delete it.

Can you confirm this? Or is the error on my side?

@ehs Nothing wrong on your side, I am just silly, I forgot to add commas after the last 3 options of mariadb_config.json in the bash script. So because the JSON was wrongly formatted, mariadb kernel was using default configuration, thus all users were starting the same MariaDB server on the same datadir, that’s why you experienced a shared environment.

Here’s the updated gist with the script changed.

Let me know if it works now.

Hi @robertbindar ,

still “wildwest” :frowning:

I checked mariadb_config.json

        {
                "user": "root",
                "host": "localhost",
                "port": "3312",
                "password": "",
                "start_server": "True",
                "client_bin": "mysql",
                "server_bin": "mysqld",
                "db_init_bin": "mysql_install_db",
                "server_datadir": "/home/jupyter-test7/datadir",
                "server_pid": "/home/jupyter-test7/mysqld-dbg.sock"
        }

Looks good. But user jupyter-test6 still has the same databases like juypyter-test7. And if you delete /create a database the other user can delete/create it…

Some things i found out:

There is no datadir in the users home dir
and mysqld-dgb.sock is also missing.

You said these should be created by jupyterhub…

Perhaps there is the missing thing?!?

My mariadb is Version 10.3.31 perhaps this is to old? But you said you have ubuntu 20.04 as well.

I do not work as root. I have a user who is in sudo group. Might that cause problems?

I hope you have some ideas left. :slight_smile:

Hey @ehs! I got it wrong again, probably copy pasted to gist the wrong stuff. The “server_pid” option was actually pointing to a .sock file and I was missing the “socket” option from config.

Can you please try the latest gist script?

Hi @robertbindar

it works !! :slight_smile: :partying_face:

I will test this tomorow or on friday in class with up to 20 users.

Thanks a lot for your help. Now i can savely start thinking about how to use this for teaching…

That’s amazing @ehs! Thanks for pursuing this and I would love to hear your feedback once you get to test the project.
Please note that latest release v0.2.0 from end of last week contains the work of GSoC intern, autocompletion of sql with TAB and introspection with SHIFT+TAB. It’s some great work, still in progress because it’s very hard to make SQL autocompletion bullet proof, but should be helpful to your students learning SQL (Documentation for this is coming soon, I’m still writing it).

Good luck designing your SQL notebooks for your classes, and please consider posting them on GitHub so others can learn too.

Also if you find any bugs, please open issues on the github repository and I’ll try to fix them as fast as possible.

1 Like

Hi @robertbindar,

i had not the chance to test it properly, because in our school the internet is not good enough.

Right ow i am planing to buy LTE Router to try with the cellphone net. This will take a while.

I will report…

I’m sorry you are facing such difficulties :frowning: Is it impossible to ask the school to reimburse you the cost of a cloud machine? The digitalocean machine I used to test stuff whilst helping you set up mariadb_kernel costs 20usd per month max, or 0.03usd per hour, I paid like 0.5usd for some hours of testing. My guess is that this kind of machine would be enough for a small class, maybe. Maybe you can go even more efficient by picking a cloud plan or something that bills on actually usage hours somehow, CPU hours (which in your case might be less than 10 hours a week probably for a class).