Solved

allow user all privileges to database

Posted on 2014-01-26
3
463 Views
Last Modified: 2014-01-27
I am using sql query editor mysql workbench

$this->_connection = new mysqli('localhost', 'sandbox', 'sandbox', 'sandbox');

I am doing a tutorial
so I want to allow username sandbox to database sandbox on localhost on mysql on windows


please make sandbox have all privileges to all databases on localhost

I can log on to mysql workbench as sandbox
but can not view sandbox database (created with user: root) as user: sandbox

I also tried with a php script and can not view sandbox

please make sandbox have all privileges to all databases on localhost please make sandbox have all privileges to all databases on localhost
0
Comment
Question by:rgb192
3 Comments
 
LVL 36

Accepted Solution

by:
Loganathan Natarajan earned 500 total points
ID: 39811129
You have to execute the below command to give full rights to the user on database,

grant all privileges on DATABASE_NAME.* to USERNAME@localhost identified by 'PASSWORD';

Open in new window


example,  so as per your db

grant all privileges on sandbox.* to sandbox@localhost identified by 'PASSWORD';

flush privileges;

Open in new window


more details,
http://dev.mysql.com/doc/refman/5.1/en/grant.html#grant-database-privileges
0
 
LVL 15

Expert Comment

by:Insoftservice
ID: 39811166
Try out this one .

GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';

FLUSH PRIVILEGES;
0
 

Author Closing Comment

by:rgb192
ID: 39812157
first to answer thanks
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
update joined tables 2 55
Insert values are dynamic 11 51
A query works with MySQL 5.6, mariadb 10.1 but fail on MySQL 5.7 6 47
MySQL Memory Keeps Increasing 4 47
More Fun with XML and MySQL – Parsing Delimited String with a Single SQL Statement Are you ready for another of my SQL tidbits?  Hopefully so, as in this adventure, I will be covering a topic that comes up a lot which is parsing a comma (or other…
I have been using r1soft Continuous Data Protection (http://www.r1soft.com/linux-cdp/) for many years now with the mySQL Addon and wanted to share a trick I have used several times. For those of us that don't have the luxury of using all transact…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question