Ubuntu Server 20.04 and Nextcloud server installed with Snap(https://github.com/nextcloud-snap/nextcloud-snap).
I need to connect to Nextcloud MySQL DB inside Snap and make SELECT on some tables, but I don't understand how to do it with python.
If I'm using standard CLI utility, everything is fine.
sudo nextcloud.mysql-client -S /tmp/sockets/mysql.sock
But I don't understand how to do the same thing with python and dedicated MySQL user.
I've tried to use 'subprocess.check_output' route, but it turns out to be a terrible idea...
Any suggestions?