1 打开mysql的bin目录
cd F:\program\phpstudy_pro\Extensions\MySQL8.0.12\bin
2 登录
.\mysql -u root -p
3 切换数据库
use mysql;
4 创建远程用户
4.1 #删除匿名用户,没有可不删
delete from user where user='';
4.2 创建远程用户
#mysql版本8.0以下使用以下命令
grant all privileges on *.* to 'ttt'@'%' identified by '123456' with grant option;
#mysql版本8.0及以上使用以下命令:
create user ttt@'%' identified by '123456'; grant all privileges on *.* to root@'%' with grant option;
5 退出并重启没有sql
quit;
net stop mysql ; net start mysql;
6开启windows端口
标签:grant,windows10,user,mysql,123456,远程 From: https://www.cnblogs.com/polax/p/16721404.html