use mysql;
update user set password=password('123456') where user='root';
update user set host='%' where user='root' && host='127.0.0.1';
添加新用户
grant all privileges on *.* to 'root'@'%或ip' with grant option;
flush privileges;
有时候绑定地址导致无法连接,可以把绑定改为0.0.0.0 或去掉