I've lost the root password and trying to reset it. I have sudo access. Reading other pages on this, I'm trying the following method using the skip-grant-tables option:
$ sudo /etc/init.d/mysql stop
[ ok ] Stopping mysql (via systemctl): mysql.service.
$ sudo mysqld --skip-grant-tables &
[1] 17849
$ mysql -u root mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
[1]+ Exit 1 sudo mysqld --skip-grant-tables
I've tried adding the -h 127.0.0.1
option too as I read somewhere else. I don't know where the mysqld.sock ought to be if it's not where it's trying to find it, I'm a little lost where to go next.
I am able to enter the MySQL prompt on another MySQL user/pw but that user doesn't have permission to access the "mysql" database to reset the password.
Any help?