Jump to content

Recommended Posts

In the past I've used cPanel for this but I've just spent about an hour trying to get a user to connect to a database and no luck!

 

I've tried following the instructions in the online MySQL documentation as well as guides online. I've even gone into phpMyAdmin and tried creating users in there manually. All permissions have been set and I still get an error message when trying to connect to the database.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'testuser'@'localhost' (using password: YES) in C:\wamp\www\test.php on line 2

ERROR: Access denied for user 'testuser'@'localhost' (using password: YES)

 

The one thing I seem to be missing is associating a user to a database once a user has been created and all permissions set. I cannot find out how to do this manually anywhere!

OK now it won't work again.

 

I've got a local domain set up called "music.local" which I can access in my browser. The code is there as I get "cannot connect" message as above.

 

I've created the database and imported all the data.

 

When I created the user zeb_music I tried adding it directly in phpMyAdmin and setting permissions below and also via the MySQL console.

 

I've tried:

grant all on *.* to zeb_music@localhost;

This says it worked but it won't connect.

 

I also tried:

grant all on *.* to zeb_music@music.local;

Which also said worked but it didn't.

 

I've tried every combination I can think of and lost count the number of times I've restarted all services.

 

All I want to do is create a user and give it access to the database but nothing is working.

Seems I was missing one word out - PRIVILEGES!

This I'm finding creates my user and grants access:

grant all privileges on *.* to zeb_music@localhost identified by 'password';

 

What was helping me to get confused was whether I should be using music.local instead of localhost.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.