Jump to content

Setting Up A User For The Web


naturephoenix

Recommended Posts

To connect to my database I manage only with :

 

$db=new mysqli('localhost','root','','name_of_database');

 

Ok I can always edit my config file, but what when I want to add some new users with their privileges.

 

This is what have I done

 

mysql>grant select, insert, update, delete, index, alter, create, drop

-> on name_of_database.*

-> to new_user identified by ‘new_user_pass’;

 

And when I open user table inside phpmyadmin, into mysql database, I see new user called

"new_user" with pass "new_user_pass".

But all privileges are set to NO.

 

Then I edit privileges manually in phpmyadmin(i set them all to YES just like user with name "root")

 

But

$db=new mysqli('localhost','new_user','new_user_pass','name_of_database');

is not working.

 

Can someone help me out with this.

Edited by naturephoenix
Link to comment
Share on other sites

When you grant privileges, you also have to flush the old ones from memory. That's the actual problem.

 

As far as the DB user goes, I reckon you were looking in the "user" table, which controls access to the entire DB server. When you grant privileges on a per-database case, you can find them in the "db" table.

Link to comment
Share on other sites

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.