mysql 安装完毕无法登陆

mysql> use mysql;
mysql> select host,user from user;
mysql> update user set host = ‘%’ where user = ‘root’;
mysql> select host,user from user;
mysql> flush privileges;
root对应的host成了%,表示可以任意IP地址登录了.

还需修改my.cnf

bind-address = 0.0.0.0