Wednesday, 7 March 2018

php - Access denied for user 'someuser'@'localhost' (using password: YES)

I have created a database by name 'somedatabase' in mysql



CREATE DATABASE somedatabase;  
GRANT ALL ON somedatabase.* TO 'someuser'@'localhost' IDENTIFIED BY 'somepassword';



but when i try to access this database using php application i get the following error




"mysql_connect() [function.mysql-connect]: Access
denied for user 'someuser'@'localhost' (using password: YES)
"




The Mysql query browser does allow me to login to this database using username : someuser and password : somepassword. Then why is that i am not able to connect to database through application.




php code :



$db_url = 'mysql://someuser:*somepassword*@localhost/somedatabase';

No comments:

Post a Comment

casting - Why wasn't Tobey Maguire in The Amazing Spider-Man? - Movies & TV

In the Spider-Man franchise, Tobey Maguire is an outstanding performer as a Spider-Man and also reprised his role in the sequels Spider-Man...