﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-i~chocolate~you-文章分类-Develop</title><link>http://www.blogjava.net/ichocolateyou/category/29310.html</link><description /><language>zh-cn</language><lastBuildDate>Sat, 01 Mar 2008 18:03:58 GMT</lastBuildDate><pubDate>Sat, 01 Mar 2008 18:03:58 GMT</pubDate><ttl>60</ttl><item><title>MYSQL不能从远程连接的一个解决方法</title><link>http://www.blogjava.net/ichocolateyou/articles/182393.html</link><dc:creator>wary</dc:creator><author>wary</author><pubDate>Wed, 27 Feb 2008 02:01:00 GMT</pubDate><guid>http://www.blogjava.net/ichocolateyou/articles/182393.html</guid><wfw:comment>http://www.blogjava.net/ichocolateyou/comments/182393.html</wfw:comment><comments>http://www.blogjava.net/ichocolateyou/articles/182393.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/ichocolateyou/comments/commentRss/182393.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/ichocolateyou/services/trackbacks/182393.html</trackback:ping><description><![CDATA[1。&nbsp;改表法。可能是你的帐号不允许从远程登陆，只能在localhost。这个时候只要在localhost的那台电脑，登入mysql后，更改&nbsp;"mysql"&nbsp;数据库里的&nbsp;"user"&nbsp;表里的&nbsp;"host"&nbsp;项，从"localhost"改称"%"<br />
<br />
<table cellspacing="1" cellpadding="10" width="95%" align="center" bgcolor="#000000" border="0">
    <tbody>
        <tr>
            <td width="100%" bgcolor="#e6e6e6">mysql&nbsp;-u&nbsp;root&nbsp;-pvmwaremysql&gt;use&nbsp;mysql;mysql&gt;update&nbsp;user&nbsp;set&nbsp;host&nbsp;=&nbsp;'%'&nbsp;where&nbsp;user&nbsp;=&nbsp;'root';mysql&gt;select&nbsp;host,&nbsp;user&nbsp;from&nbsp;user;</td>
        </tr>
    </tbody>
</table>
<br />
<br />
2.&nbsp;授权法。例如，你想myuser使用mypassword从任何主机连接到mysql服务器的话。<br />
<br />
<table cellspacing="1" cellpadding="10" width="95%" align="center" bgcolor="#000000" border="0">
    <tbody>
        <tr>
            <td width="100%" bgcolor="#e6e6e6">GRANT&nbsp;ALL&nbsp;PRIVILEGES&nbsp;ON&nbsp;*.*&nbsp;TO&nbsp;'myuser'@'%'&nbsp;IDENTIFIED&nbsp;BY&nbsp;'mypassword'&nbsp;WITH&nbsp;GRANT&nbsp;OPTION;</td>
        </tr>
    </tbody>
</table>
<br />
<br />
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器，并使用mypassword作为密码<br />
<br />
<table cellspacing="1" cellpadding="10" width="95%" align="center" bgcolor="#000000" border="0">
    <tbody>
        <tr>
            <td width="100%" bgcolor="#e6e6e6">GRANT&nbsp;ALL&nbsp;PRIVILEGES&nbsp;ON&nbsp;*.*&nbsp;TO&nbsp;'myuser'@'192.168.1.3'&nbsp;IDENTIFIED&nbsp;BY&nbsp;'mypassword'&nbsp;WITH&nbsp;GRANT&nbsp;OPTION;&nbsp;</td>
        </tr>
    </tbody>
</table>
&nbsp; 
<img src ="http://www.blogjava.net/ichocolateyou/aggbug/182393.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/ichocolateyou/" target="_blank">wary</a> 2008-02-27 10:01 <a href="http://www.blogjava.net/ichocolateyou/articles/182393.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>