Solved

allow user all privileges to database

Posted on 2014-01-26
3
456 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
Comment Utility
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
Comment Utility
Try out this one .

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

FLUSH PRIVILEGES;
0
 

Author Closing Comment

by:rgb192
Comment Utility
first to answer thanks
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now