作者:Less哒哒_288 | 来源:互联网 | 2023-10-17 10:59
1打开mysql的bin目录cdF:\program\phpstudy_pro\Extensions\MySQL8.0.12\bin 2登录.\mysql-uroot-p3切换数据
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端口
