whenever I am trying to connect phpMyadmin through php script it is showing some errors like this Warning: mysql_connect(): Access denied for user 'www-data'@'localhost' (using password: NO) I am using ubuntu 11.04.So can you tell me how to solve this?
2 Answers
This error simply means that your connection information is incorrect. You are trying to connect to the MySQL database using the username "www-data@localhost" with no password. Check your MySQL permissions to see what you need to do. Either this login needs a password or this login is not specified as being permitted to access the data.
To check what permissions you have for that user, run this MySQL script:
SELECT * FROM user WHERE user='www-data';
To add rights to that user (if they are missing), run this script:
GRANT SELECT ON database.* TO 'www-data'@'localhost';
1 Comment
Neeraj Kumar
Biggs is right. also, on a dev box you can use the root usename and password u specified during mysql installation. if you are not comfortable with CLI you can install link for web interface. you can also use tasksel for performing various tasks like installing AMP on linux box in one go.