I am trying to install MySQL in Ubuntu 18.04.
I used the command apt-get install mysql-server
, but it did not ask for root password while installing.
I referred to the solution on this question, but it shows error on this step sudo mysql --user=root mysql
.
Error is `ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)`.
So I tried the top answer on this link,
and when I checked, there was no /etc/my.cnf
config file.
I also tried to reset the password using the answer by "davejal" on the previous link, but it gives the same error on this step mysql -uroot
.