In short,I have inherited a project... it has a live production site running on a LAMP stack. I have root access to the server nobody knows the mysql root password. In addition the user that the application uses cannot access the mysql client, for some reason the credentials only work from the application.
I am trying to reset the root password using the instructions from mysql https://dev.mysql.com/doc/refman/5.7/en/resetting-permissions.html
The server is running ubuntu 16 lts with mysql 5.7.19.
Following the above guide, they instruct mysql to be shutdown with the following:
kill `cat /mysql-data-directory/host_name.pid`
I run the sql script on startup... but the result is i still cannot login to the mysql shell via root :/
Anyone got a solid way to reset the root pass..?
Trying to get the service running with the skip grant tables and networking:
- Stop the service:
/etc/init.d/mysql stop
LOG OUTPUT - Start the service with mysqld and options:
mysqld --skip-grant-tables --skip-networking --user=root &
the output Try to start the client but the client says:
root@...:/home/john# mysql -u root ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
1+ Exit 1 mysqld --skip-grant-tables --skip-networking --user=root
When starting the mysql server this is the LOG OUTPUT
The answer below was correct, just ensure you have the /var/run/mysqld/
else mysqld cannot start.