mysql 允许别人远程连接操作步骤

mysql在默认配置下是不允许除本机之外的ip访问的,那如何让mysql能让其他机器访问?

在MysqlWorkBench里执行如下命令

use mysql;

update user set host = '%' where user ='root';

如果控制台输出如下:

update user set host = '%' where user ='root'        Error Code: 1175. You areusing safe update mode and you tried to update a table without a WHERE thatuses a KEY column To disable safe mode, toggle the option in Preferences ->SQL Editor and reconnect.         0.031sec

那是因为开启了安全模式,关闭安全模式如下所示:

菜单:Edit-Preferences下

在SQL Editor页面最下方去掉 Safe Updates的勾选即可。

猜你喜欢

转载自www.cnblogs.com/bjxq-cs88/p/9187020.html