问题描述:
A电脑ip(192.168.1.105)使用navicat连接B电脑ip(192.168.1.107)的mysql数据库时,出现
1045 Access denied for user 'username'@'ip' (using password:YES)错误
问题原因:
mysql没有对B电脑的ip、username授权,所以无权访问
解决办法:
A电脑中执行授权语句,即可正常连接
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.107' IDENTIFIED BY '1234' WITH GRANT OPTION;
FLUSH PRIVILEGES;
username:root
ip:192.168.1.107
password:1234