MySQL Forums
Forum List  »  Newbie

Connecting to database
Posted by: Ciara McCarthy
Date: April 15, 2005 02:47AM

Hello,

Ive only started using MySQL this week and fraid im getting stuck on the basics! Im using the mysql server from a localhost and having problems connecting to the database. (im using a php programme for the mysql queries)

I can connect to mysql itself if i use the default settings: mysql_connect("localhost")

But when i try to connect to my database i keep getting the same error messages:
"Access denied for user: '@localhost' (Using password: NO)"

Ive tried creating a new user in MySQL and granting privileges such as:
GRANT ALL PRIVILEGES ON my_database.* TO user@'%' IDENTIFIED BY 'passw';

When i change the connect settings to: mysql_connect("localhost", "user", "passw")
then i dont connect to mysql, but get an error message saying:
"MySQL connection failed: Access denied for user: 'user@localhost' (Using password: YES)"

I have no idea where im going wrong!! any ideas would be much appreciated : )
thanks,
Ciara

Options: ReplyQuote


Subject
Written By
Posted
Connecting to database
April 15, 2005 02:47AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.