设置Mysql允许其他电脑远程访问
2017-06-01
相关话题
在实际应用中常常需要设置mysql,允许其他电脑远程访问,以便达到共享数据库的目的。下面是小编跟大家分享的是设置Mysql允许其他电脑远程访问,欢迎大家来阅读学习~
设置Mysql允许其他电脑远程访问
工具/原料
mysql
Windows
cmd
方法/步骤
打开mysql数据库,用root用户名登陆数据库。

查看数据库中名为mysql的数据库中user表的host、user、以及密码等,此时有user名为root的记录,如果想让远程电脑连接数据库,需添加一台user名为root,host为名“%”的记录,也可以再设置访问密码。可以用cmd添加记录。

按住win+R键,回车,打开cmd

在cmd中输入如下红色框中的信息,每输入一行按下回车,完成后退出cmd即可。

在查看mysql,在mysql数据库的user表中会多出一条user名为root,host为“%”的记录,说明添加成功。下面检验是否可以远程连接,可以在本机进行测试。

你可以打开eclipse,查看data source explorer中的任意数据库,单击右键选中properties中的driver properties,设置如图信息。点击test connection,弹出如图信息,则设置正确。
