I read and followed the process on https://websiteforstudents.com/install-mysql-8-0-on-ubuntu-16-04-17-10-18-04/ to install mySql on my ubuntu virtual machine. Everyhting run just absolutely fine. But when i try to
sudo mysql -u root -p
on the terminal it gives error like
Access denied for user 'root'@'localhost' (using password: YES)
I am not able to even reset my password as nothing is opening. Is there any way to reset password (if that's the problem) from the terminal.
UPDATE
I read on How to find out the MySQL root password the way but after the first
sudo service mysql stop
when i try to
sudo mysqld_safe --skip-grant-tables
It gives me error like
2018-06-27T06:24:15.801227Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2018-06-27T06:24:15.802880Z mysqld_safe Directory '/var/run/mysqld' for UNIX socket file don't exists.
I repeated the whole download process still the error seems to persist. Moreover though i am the admin using
mkdir -p /var/run/mysqld
tells me that i dont have the permission to do the creation
mkdir -p /var/run/mysqld