0

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.

Eliah Kagan
  • 117,780

1 Answers1

0

Is the mysql service running? Try

sudo service mysql status

There should see something like this on the third line

Active: active (running) since Thu 2018-09-06 13:29:28 CEST; 3s ago

If not, you can start the mysql service with

sudo service mysql start