-1

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.

Michał Turczyn
  • 32,028
  • 14
  • 47
  • 69
icewizard
  • 133
  • 1
  • 13
  • Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Unix & Linux Stack Exchange](http://unix.stackexchange.com/) or [Database Administrators Stack Exchange](http://dba.stackexchange.com/) would be a better place to ask. – jww Aug 02 '18 at 01:56

1 Answers1

0

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.
Robbie
  • 17,605
  • 4
  • 35
  • 72
  • alright I got into mysql and changed it. now I'm trying to start the server up again and typed this `orpheus@Roedelius:~$ /etc/init.d/mysql start` now my terminal says this `[....] Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details. failed!`. Why did it fail? – icewizard Aug 02 '18 at 01:56
  • Did you read what you typed and follow through? The hint is provided to you - and you copied it right there! – Robbie Aug 02 '18 at 02:01