mysql服务器显示禁用,为什么会出现“不允许主机'192.168.1.220'连接到该MySQL服务器”的信息?...

I need to run MySQL (phpMyAdmin) on a LAN. This is my connection string:

Function Connection() As MySqlConnection

'Connect Database

MyConnection.ConnectionString = "server=192.168.1.101;" _

& "user id=root;" _

& "password=;" _

& "database=db1230018;"

'

MyConnection.Open()

Return MyConnection

End Function

I get an error:

Host '192.168.1.220' is not allowed to connect to this MySQL server

I have two PCs. One of them (Windows 7 - 192.168.1.101) runs a WAMP server (phpMyAdmin) and a VB.NET application using the above connection string. Now I want to run the application on the second pc (Windows) using the same database in 192.168.1.101. I already define a fixed IP on both PCs and disable firewalls. What's going on?

解决方案

Probably you have no access rule defined for root@192.168.1.220. Then the server refuses this connection.

Besides, you have to remove the restriction about the bind address in the config file.

Here you are told how that works:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

FLUSH PRIVILEGES;

in MySQL and remove the line

bind-address = 127.0.0.1

from /etc/mysql/my.cnf.

As you get the said message from the server, it might be that the latter step isn't necessary any longer. Otherwise, you would get a message from the client that it is unable to connect to the server.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值