在windows系统中使用Navicat远程连接虚拟机中的mysql服务,报错1045 - Access denied for user 'root'@'::1' (using password: YES)
检查mysql服务 是正常启动的
service mysqld status
或者:
netstat -tnulp |grep mysqld
查看端口的命令
netstat -an|grep 3306
iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
mysql->use mysql;
你想root使用xxxxx从任何主机连接到mysql服务器的话。执行以下命令,赋予root用户远程访问权限
mysql->GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'xxxxx' WITH GRANT OPTION;
mysql->FLUSH PRIVILEGES;
刷新 然后重启mysql服务
service mysqld restart
再使用Navicat连接 就可以了