Additional info below.
From README.Debian of mysql-server-5.7 package distributed by Ubuntu:
* MYSQL WON'T START OR STOP?:
=============================
You may never ever delete the special mysql user "debian-sys-maint". This
user together with the credentials in /etc/mysql/debian.cnf are used by the
init scripts to stop the server as they would require knowledge of the mysql
root users password else.
So in most of the times you can fix the situation by making sure that the
debian.cnf file contains the right password, e.g. by setting a new one
(remember to do a "flush privileges" then).
From /etc/init.d/mysql script of the same package:
...
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"
...
mysqld_status () {
ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))
...
'stop')
...
log_daemon_msg "Stopping MySQL database server" "mysqld"
if ! mysqld_status check_dead nowarn; then
set +e
shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
set -e
...
While it could stop the server by sending TERM to mysqld, you should be able to see that mysqladmin tool and debian-sys-maint user is being used.
MariaDB packages claims that it does not use this user anymore, but in my installation debian.cnf does contain it's credentials.