mysql error ERROR 1698 (28000): Access denied for user 'root'@'localhost' on Ubuntu 16.04 LTS
<p>I have installed mysql server and I logged in with <code>mysql -u root -p</code> and it was working good. But then I moved my data directories to another location, now when i use <code>mysql -u root -p</code> it shows me error like  <code>mysql error ERROR 1698 (28000): Access denied for user 'root'@'localhost'</code>  but if I try to login with <code>sudo mysql -u root -p</code> this command allows me to connect. Because of this i event can't able to connect with MySql Workbench. 
Please Help me. As I am new to linux i don't have much knowledge about it.</p>