打开此链接按照命令执行即可
https://downloads.mariadb.org/mariadb/repositories/#mirror=tuna&distro=Debian&distro_release=stretch--stretch&version=10.2

/etc/init.d/mysql start | stop
启动后登录如果提示
ERROR 1524 (HY000): Plugin 'unix_socket' is not loaded
执行
sudo mysqld_safe --skip-grant-tables &

参考:https://www.linuxbabe.com/mariadb/plugin-unix_socket-is-not-loaded-2