grant all permissions to a user on mysql database

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'@'';

I tried

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

that didn't work though.

Who is Participating?
sammySeltzerConnect With a Mentor Commented:
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.
Have  you tried:
    ON mydatabase.*
    TO root@localhost
     IDENTIFIED BY 'newpassword';
RupertAAuthor Commented:
hi sammy, why would I do the

IDENTIFIED BY 'newpassword';


Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

wouldn't you want the user to have password?
so basically, if you wish to grant permission to a user called root, then you need to identify that user by his/her password.

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:
wolfgang_93Connect With a Mentor Commented:
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:

RupertAAuthor Commented:
Sammy's did solve this but Wolfgang's info was very helpful to aid my understanding so I am going to do 50/50.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.