-2

I installed Mysql server following the guide.

In terminal: mysql -u root

and receiving error:

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

What I am doing wrong?

Additionally, I cannot sudo apt install mysql-workbench (it is not found in repository)

andrew17
  • 851
  • 2
  • 10
  • 25

1 Answers1

1

Try sudo mysql -u root -p.

I believe it's some kind of security feature or something like that (not entirely sure). But with su/sudo rights, you can connect to the socket. The -p option will ask for password input

Added after a comment about symbols in the password:

My assumption is that the encoding of these characters isn't correct (ASCII connection, and non-ASCII charaters). Try connection with the following command, as stated in this SO answer by Martin Taleski

sudo mysql --default-character-set=utf8 -u root -p

You can set this as a default in the /etc/mysql/my.cnf file.

[mysql]
default-character-set=utf8
Mathlight
  • 6,436
  • 17
  • 62
  • 107