Thursday, 2 June 2016

php - mysql_connect: Access denied



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 "")






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?


Answer



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.



No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...