Unable to run mariadb in safe mode
You startt the server with following restrictions


  (Then) ithout a password and with all privileges, and disables account-management statements such as ALTER USER and SET PASSWORD. Because this is insecure, if the server is started with the --skip-grant-tables option, it also disables remote connections by enabling skip_networking. 


This comes from how to reset root passwored

The safe mode is only practical, when doing ridumietery things like resetting roor password.

So explain better what you want to do, maybe there is a better or otheer  solution