The command:
mysql -u root -p
gives the error:
ERROR 1698 (28000): Access denied for user \'root\'@\'localhost\' >
ERROR 1698 (28000): Access denied for user \'root\'@\'localhost\'
You can use the below query:
GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
This query is enough.