Why not run MySQL?

Hello. Work with MySQL using Ubuntu. Before all the normally run from the terminal the mysql command. Now when this same command in the console I see the following:
"ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)"

Run mysql -u root gives the same result. What could be the problem?
July 4th 19 at 23:04
2 answers
July 4th 19 at 23:06
Solution
The problem - forgot/set password
One solution: in the file /etc/mysql/my.cnf find the section [mysqld] to add skip-grant-tables
example:
[mysqld]
skip-grant-tables

Restart MySQL
sudo service mysql restart (or without sudo if root access)
to try to go
mysql-u root-p
If failed to login, then set a new password
use mysql;
UPDATE user SET Password=PASSWORD('your_password') WHERE User='root';
quit

return the contents of /etc/mysql/my.cnf to its original state (remove skip-grant-tables)
and again restart MySQL
For "UPDATE user ..." it's the beat. Learn manuals, the correct change password user: GRANT USAGE ON dbname.* TO username@servername IDENTIFIED BY 'password'; - Henriette_Ernser commented on July 4th 19 at 23:09
: Thank you for your care, but specifically in this case, You are wrong. Assign a first password by using the command grant or set password will not work, as in mode, skip-grant-tables cannot be used. - novella_Hermiston36 commented on July 4th 19 at 23:12
Thank you for the correction, missed time with skip-grant-tables - Henriette_Ernser commented on July 4th 19 at 23:15
: console throws this " Unknown column 'password' in 'field list'
"when trying to update the password. Up to this point everything went fine - heloise13 commented on July 4th 19 at 23:18
Options usually are several, the user table is corrupted, MB Password write in small letters ? - novella_Hermiston36 commented on July 4th 19 at 23:21
: Similarly, you have Unknown column 'password' in 'field list' - the First letter of the title must be exactly as in my example... - novella_Hermiston36 commented on July 4th 19 at 23:24
even when writing with a capital letter, the same problem remains - heloise13 commented on July 4th 19 at 23:27
: thanks, understood - heloise13 commented on July 4th 19 at 23:30
July 4th 19 at 23:08
Solution
No password will not let me - so root with a password. To go through mysql-u root-p
If you forget your password, see the answer from .
Option without restarting: in the file /etc/mysql/debian.cnf look the password for the system user debian-sys-maint, go through it and change the password for root.

Find more questions by tags LinuxMySQLUbuntu