dsgk0386 2012-06-22 08:57
浏览 84
已采纳

mysql_connect:访问被拒绝

I´ve found the google-tutorial for store locator: https://developers.google.com/maps/articles/phpsqlsearch_v3#findnearsql

The MySQL-table is done, it works on my server. I can write addresses and do correctly in phpmyadmin

SELECT id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) AS distance FROM markers HAVING distance < 25 ORDER BY distance LIMIT 0 , 20;

But at the tutorial point "Outputting XML with PHP" I can´t go on.

I´ve created the file "phpsqlsearch_dbinfo.php", put my database details in and uploaded it. (all the things in "")

<? $username="username"; $password="password"; $database="username-databaseName"; ?>

Then I created "phpsqlsearch_genxml.php" as written, put the code from the tutorial in and uploaded it also. Which parts have I to change?

When I start the file in the browser there is the following message:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'dbo420324620@localhost' (Using password: YES) in /homepages/6/d11799920/htdocs/markisen/mx/2/phpsqlsearch_genxml.php on line 15
Not connected : Access denied for user: 'dbo420324620@localhost' (Using password: YES)

What have I done wrong?

  • 写回答

2条回答 默认 最新

  • dongren4099 2012-06-22 11:18
    关注

    Either your username, password or database name is wrong.

    The error message is deliberately vague in order that unauthorised system-crackers are not helped to find out what they need to change; although I guess you know your username and password.

    It's possible the database name you need to use in your PHP code is not exactly the same as that shown in phpMyAdmin. Ask your hosting company what you should use in your include file.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘