如何设置Windows Server 2008 for MySQL远程数据库连接?

时间:2013-01-11 15:51:55

标签: php mysql windows mysqli windows-server-2008

我对这个服务器设置和数据库连接非常陌生。我google了很多,但无法找到它的解决方案。我正在开发一个需要将数据发布到远程数据库的android应用程序。这样做了。

现在我必须在新MySQL Database中设置Windows Server 2008。我已安装并设法访问root用户(这很好)。现在我想从我的本地计算机[ iMac ]访问此数据库。我已按照此link设置了权限。当我尝试从我的Web应用程序运行时,它显示以下错误。

 Error: unable to connect to database. Host 'xx.xx.xxx.x' is not allowed to connect to this MySQL server

以下是我的问题

1.。)如何从任何计算机访问远程MySQL数据库?

2.。)如何在服务器中运行Web应用程序?比如Web Hosting即我是否需要设置ftp帐户并将内容放在那里?(For Eg: testhost.com/connecttodatabase.php执行此操作它将执行testhost中的任何代码服务器。但我不知道如何为我的服务器做这件事。)

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:3)

或者,您也可以尝试......

use the_database_name;

GRANT ALL PRIVILEGES ON 
the_database_name.* 
TO 
'the_user_in_php_code'@'%' 
IDENTIFIED BY 
'password_of_the_user_in_php_code';

FLUSH PRIVILEGES;

源: http://forums.devshed.com/mysql-help-4/host-is-not-allowed-to-connect-to-this-mysql-server-366908.html

相关问题