0

I installed mysql server on my Ubuntu 16.04 LTS (mysql-server). When prompted for root password, as shown in the attached image, I chose to skip (entered Enter).

enter image description here

But when finished installing, I can't run mysql with root user:

m1@alex:~$ mysql -u root
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

What's the issue here? I see some answers for setting password but I was following a tutorial (on the left half of the image posted and they do it successfully without the password and I'd like to do the same.) ~

Lavya
  • 1,475
  • 2
  • 17
  • 21
  • Maybe a duplicate: http://stackoverflow.com/a/11216911/3305116 – vard Nov 15 '16 at 15:59
  • @vard I don't think it's related. I've freshly a installed Ubuntu setup and I haven't tempered with any domain names/addresses. – Lavya Nov 15 '16 at 16:09
  • Did you tried "mysql -u root -p" and enter without a password? – Przemysław Jagielski Nov 15 '16 at 17:24
  • @PrzemysławJagielski yes. same error: `m1@alex:~$ mysql -u root ERROR 1698 (28000): Access denied for user 'root'@'localhost' m1@alex:~$ mysql -u root -p Enter password: ERROR 1698 (28000): Access denied for user 'root'@'localhost' ` – Lavya Nov 16 '16 at 01:18

1 Answers1

0

It was because of missing sudo it seems..

I got the hint from Matt's comment on the accepted answer here

Community
  • 1
  • 1
Lavya
  • 1,475
  • 2
  • 17
  • 21