错误是什么,关键是看:Access denied for user 'root'@'localhost' (using password: YES)'
从错误中可以看出你的权限是对localhost的访问没有放开。
于是你可以使用如下命令来放开权限:
首先计入到mysql的客户端命令行。
然后
grant all privileges on *.* to 'root'@'localhost' identified by ' root(你的密码)' with grant option;
flush privileges;
执行完这两条命令之后就可以了。