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.

Link to comment
https://forums.phpfreaks.com/topic/269191-setting-up-a-user-for-the-web/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.