gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-03 12:33:37 25 4
gpt4 key购买 nike

我对此服务器设置和数据库连接非常陌生。我在谷歌上搜索了很多但找不到解决方案。我正在开发一个需要将数据发布到远程数据库的 android 应用程序。完成了。

现在我必须在新的 Windows Server 2008 中设置 MySQL 数据库。我已经安装并设法访问 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 应用程序?比如虚拟主机,即我是否需要设置 ftp 帐户并将这些东西放在那里?(例如:testhost.com/connecttodatabase.php 通过执行它,它将执行测试主机服务器中的任何代码。但我不知道如何为我的服务器执行此操作)。

非常感谢任何帮助。

最佳答案

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

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

关于php - 如何为 MySQL 远程数据库连接设置 Windows Server 2008?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14281753/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com