商店&a​​mp;访问远程服务器上的数据库

时间:2012-03-20 13:32:33

标签: android mysql database

我将我的sql数据库上传到远程服务器(eu5.org)。我正在使用PHP脚本来访问该数据库。要建立连接,有这个命令..

$con = mysql_connect("host","username","password");

现在我不知道在这些字段中要指定什么..

host: localhost or 127.0.0.1 or eu5.org (while logging in there is a field FTP Server: eu5.org).

username: vipul.eu5.org(my domain at this site) or root(username for localhost) or 666666(a 6 digit numeric username for accessing phpmyadmin of eu5.org)

password: my password at eu5.org or password of local mysql database (phpmyadmin).

此后,还有这个命令

mysql_select_db("database name", $con);
在我的localhost

我的数据库名称是“main”。将它导入到eu5.org的phpmyadmin之后..我的数据库表格列在数据库名称“666666”下(用于phpmyadmin的6位自动生成的用户名)

我是初学者......任何帮助都会受到赞赏..

我能够运行我的phpscript并在localhost

访问我的数据库

1 个答案:

答案 0 :(得分:0)

您没有权限设置。代码没问题,你传递用户名,密码和主机,这就足够了。也许你使用了错误的用户名或密码。