重置root密码时sudo mysqld_safe --skip-grant-tables&,/ var / lib / mysql错误

I've been trying to reset my forgotten root password in mysql. When I first tried to stop my mysqld service and tried mysqld --skip-grant-tables I got this error

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'

(2) Ask Question the same problem here

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2).

The top comment said to do something with the my.conf file and I found it here

orpheus@Roedelius:/etc/mysql$ ls
conf.d      debian-start  my.cnf.fallback  mysql.conf.d
debian.cnf  my.cnf        mysql.cnf

I did'nt know what to do from here with the my.cnf file.

opened my.cnf file in it has this in it besides comments -

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

so I tried the same method of restarting my mysql server and stopping it, then using --skip-grant-tables, but I got this error that time -

  2017-02-10T17:05:44.870970Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2017-02-10T17:05:44.872874Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2017-02-10T17:05:44.874547Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists

the same problem here mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists . I followed the top answers steps doing this mkdir -p /var/run/mysqld chown mysql:mysql /var/run/mysqld and then tried getting into mysql with --skip-grant-tables again but now I'm getting this error

orpheus@Roedelius:/$ sudo mysqld_safe --skip-grant-tables &
[2] 17057
orpheus@Roedelius:/$ 2018-08-02T01:11:46.843096Z mysqld_safe Logging to syslog.
2018-08-02T01:11:46.845788Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2018-08-02T01:11:46.859083Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql

My terminal just says that now and not letting my type anything. All the answers I'm finding on stackoverflow to reset my root password just keep leading to errors and I'm not sure if Im breaking some things by following some of the directions to fix these errors. I'd appreciate any help with my current error and resetting my root password.

That's not an error: you've started the MySQL server. Now you need to talk to it!

Options:

  1. Open ANOTHER terminal window, and connect using "mysql" and update your password, or
  2. Use "nohup" by running hohup mysqld_safe --skip-grant-tables & (as sudo) as that will return control to your terminal where you can then connect.