在執行

$ sudo mysql_upgrade -uroot -p

跳出權限問題如下
ERROR 29 (HY000) at line 162: File ‘/var/log/mysql/slow.log’ not found (Errcode: 13 “Permission denied”)
FATAL ERROR: Upgrade failed

嘗試chmod 及chown 修改 /var/log/mysql/slow.log 權限及擁有者,沒能解決。
檢查了my.cnf設定檔

slow-query-log-file = /var/log/mysql/slow.log
將其修改為
slow-query-log-file = /var/log/mariadb/slow.log

完成即可正常進行upgrade