Unable to run mariadb in safe mode When I run following command

mysqld_safe --skip-grant-tables &amp;

I get message

myuser@myvm:~$ 200523 08:24:41 mysqld_safe Logging to syslog.
200523 08:24:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

After that when I type mysql then I get following error:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2 "No such file or directory")

How do I restart mariadb in safe mode to reset root password?
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