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

在安装mysql的使用账户和密码登陆的时候出现了提示

C:\Users\Lenovo>mysql -uroot -p8FY6>5djRy+D
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

怎么才能成功的登陆上呀

-p和密码之间要有空格,不要连到一起

先输入 mysql -u root -p 然后回车,再输入密码

  1. mysql -uroot -p 回车
  2. 输入密码 回车