<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[[实践OK]BHost 127.0.0.1 is not allowed to connect to this MySQL serverConnection closed by foreign host.is not allowed to connect to this MySQL server解决办法]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[数据库技术]]></category>
<pubDate>Fri, 05 Feb 2016 02:49:57 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	碰到问题一：<br/><textarea name="code" class="php" rows="15" cols="100">
[root@iZ25dcp92ckZ]# telnet localhost 3306
Trying 127.0.0.1...
Connected to localhost.
Escape character is &#039;^]&#039;.
BHost &#039;127.0.0.1&#039; is not allowed to connect to this MySQL serverConnection closed by foreign host.
</textarea><br/><br/><br/>安装了MySQL，然后用 telnet　ip　3306,端口后报BHost &#039;127.0.0.1&#039; is not allowed to connect to this MySQL serverConnection closed by foreign host,虽然自己以前也碰到过，后来解决了,但是觉得还是值得贴出来,估计会有很多人同样碰到过,贴个解决办法:<br/><br/>MySQL&gt;UPDATE MySQL.user SET Host=&#039;%&#039; WHERE Host=&#039;localhost&#039;;&nbsp;&nbsp;<br/>MySQL&gt;GRANT ALL PRIVILEGES&nbsp;&nbsp;<br/><br/>这样搞如果该服务器在外网，有可能不安全，因为%的意思是谁都都可以连接的意思，最好是指定IP地址能连接，如问题二所示。<br/><br/>碰到问题二：<br/><textarea name="code" class="php" rows="15" cols="100">
[root@iZ25dcp92ckZ]# telnet 10.44.202.166 3306
Trying 10.44.202.166...
Connected to 10.44.202.166.
Escape character is &#039;^]&#039;.
FHost &#039;10.44.202.166&#039; is not allowed to connect to this MySQL serverConnection closed by foreign host.
</textarea><br/><br/>处理方法有二个<br/>1、(如何解决客户端与服务器端的连接(mysql) ：xxx.xxx.xxx.xxx is not allowed to connect to this mysql serv <br/>) 授权法。例如，你想myuser使用mypassword从任何主机连接到mysql服务器的话。<br/> <br/>GRANT ALL PRIVILEGES ON *.* TO ‘myuser’@&#039;%’ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;<br/>如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器，并使用mypassword作为密码<br/> <br/>GRANT ALL PRIVILEGES ON *.* TO ‘root’@’192.168.1.3′ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION;<br/>GRANT ALL PRIVILEGES ON *.* TO ‘root’@’10.10.40.54′ IDENTIFIED BY ’123456′ WITH GRANT OPTION;<br/><br/>2、 改表法。可能是你的帐号不允许从远程登陆，只能在localhost。这个时候只要在localhost的那台电脑，登入mysql后，更改 “mysql” 数据库里的 “user” 表里的 “host” 项，从”localhost”改称”%”<br/>这个是因为权限的问题，处理方式如下：<br/> <br/>shell&gt;mysql --user=root -p<br/>输入密码<br/> <br/>mysql&gt;use mysql<br/>mysql&gt;GRANT SELECT,INSERT,UPDATE,DELETE ON [db_name].* TO [username]@[ipadd] identified by &#039;[password]&#039;;<br/><br/>[username]:远程登入的使用者代码<br/>［db_name]:表示欲开放给使用者的数据库称<br/>[password]:远程登入的使用者密码<br/>[ipadd]:IP地址或者IP反查后的DNS Name，此例的内容需填入&#039;60-248-32-13.HINET-IP.hinet.net&#039; ，包函上引号(&#039;)<br/><br/>（其实就是在远端服务器上执行，地址填写本地主机的ip地址。）<br/><br/>也可以这样写<br/> <br/>mysql -u root -pvmwaremysql&gt;use mysql;mysql&gt;update user set host = ‘%’ where user = ‘root’;mysql&gt;select host, user from user;<br/><br/>分别来自：<br/>http://database.51cto.com/art/201006/204016.htm<br/>http://www.111cn.net/database/mysql/42040.htm
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [实践OK]BHost 127.0.0.1 is not allowed to connect to this MySQL serverConnection closed by foreign host.is not allowed to connect to this MySQL server解决办法]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>