第三步:登录成功后,运行代码如下:
//1、关闭远程访问代码: use mysql; update user set host = "localhost" where user = "root" and host = "%"; flush privileges; //2、开启远程访问代码: use mysql; update user set host = "%" where user = "root"; flush privileges;
关闭成功
第四步:运行关闭或开启3306端口代码后,需要重启mysql数据库才能算成功。这里我们使用笨方法,重启服务器就可以了!