Q:

mysql error Access denied for user 'root'@'localhost'

I just installed MySQL on my pc using tutorial on the YouTube every thing set to default options during the installation the tutorial said that after the installation done I should open the MySQL 8.0 commend line client and then I should type the password to connect the database but when I open it and after I type my password it's close when I press enter so I tried to use the work MySQL workbench it's gives me this popup error    I search on the internet for solution I got this here but this solution for ubuntu none of the answers are not applicable on windows but some other solution gives me some other errors :
C:\Users\husam>mysql -u root -p
Enter password: ***************
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

C:\Users\husam>mysql
ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO)

I want to use the MySQL with ruby on rails project on windows 10 

A:

the issue wan in my password it's contain ' so I removed it and everything works fine 

