Windows安装MySQL后怎么开启root的网络访问权限

minseo / 2023-08-19 / 原文

Windows安装MySQL后默认只能本机访问,怎么开启网络访问

mysql> create user 'root'@'%' identified by 'password';
Query OK, 0 rows affected (0.00 sec)

mysql> grant all on *.* to 'root'@'%';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)