登录MySQL: mysql -u root -p
如需修改密码,第一次: mysqladmin -u root password NEWPASSWORD
已设置过: mysqladmin -u root -p ‘oldpassword‘ password newpassword
执行以下命令开启远程访问限制 grant all privileges on *.* to ‘root‘@‘192.168.0.1‘ identified by ‘password‘ with grant option;
flush privileges;
exit;
上面的是开启的IP 192.168.0.1的,如要开启所有的,用%代替IP
grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘password‘ with grant option;
时间: 2024-11-25 21:25:15