Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

grant all permissions to a user on mysql database

Posted on 2010-11-08
8
Medium Priority
?
907 Views
Last Modified: 2012-05-10
Hi, I want to grant all permissions to a user on mysql database. I have logged on as administrator to the computer (i.e not on a domain). Computer is windows xp pro.

I know the following works for granting on an IP address

GRANT ALL ON mydatabase.* TO 'root'@'194.130.56.167';

I tried

GRANT ALL ON mydatabase.* TO 'root'@'administrator';

that didn't work though.

Thanks.
0
Comment
Question by:RupertA
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
8 Comments
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 34086299
Have  you tried:
GRANT ALL PRIVILEGES
    ON mydatabase.*
    TO root@localhost
     IDENTIFIED BY 'newpassword';
0
 

Author Comment

by:RupertA
ID: 34086364
hi sammy, why would I do the

IDENTIFIED BY 'newpassword';

part?

thanks
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 34086767
wouldn't you want the user to have password?
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
LVL 29

Expert Comment

by:sammySeltzer
ID: 34086777
so basically, if you wish to grant permission to a user called root, then you need to identify that user by his/her password.

0
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 1000 total points
ID: 34086800
If you don't wish to identify the user by password, then I think this will work:
GRANT ALL PRIVILEGES ON mydatabase.* TO root@localhost

If it is not localhost, then enter servername there.
0
 
LVL 29

Expert Comment

by:sammySeltzer
ID: 34086821
One last point here.

Reason yours is not working when you substitute ip address with administrator is that you are confusing the system.

It should either be ip address or servername:
0
 
LVL 8

Assisted Solution

by:wolfgang_93
wolfgang_93 earned 1000 total points
ID: 34086907
By default the MySQI id root already has full access to all objects in all databases.

Generally you do not want to change anything about root other than to give it a
password (be default root does not have a password and it is VERY important
that it has one).

To setup other users and give them access to a particular database (I am perhaps
including some stuff that you have already done toward setting things up):

Issue the following commands as the id "root" (which is allowed to create new
users and give them access):

Create a new user "administrator" with password "xyz" allowed to access the system
from any client:
   GRANT USAGE ON *.* TO administrator@'%' IDENTIFIED BY 'xyz'

Create a new database called "mydatabase" if you haven't done it already:
   CREATE DATABASE mydatabase

Give user "administrator" via any client machine full access to the new database:
   GRANT USAGE ON *.* TO administrator@'%' IDENTIFIED BY 'xyz'

Finally flush the cache and make the new privileges stick:
   FLUSH PRIVILEGES

0
 

Author Comment

by:RupertA
ID: 34092214
Sammy's did solve this but Wolfgang's info was very helpful to aid my understanding so I am going to do 50/50.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

610 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