SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Addict goldensona's Avatar
    Join Date
    Jun 2011
    Posts
    226
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Grant previlage problem -mysql

    Hi

    i have create user in myql

    Code:
    CREATE USER 'testuser'@'localhost' IDENTIFIED BY 'testpass'"
    then assign privileges to the user for particular db,that user should have all privileges create,select,insert etc...

    so i have use the query like this

    Code:
      GRANT ALL PRIVILEGES ON  dbname.* TO testuser'@% IDENTIFIED BY 'testpass'")
    it show the privileges option as usage only in mysql, how can i give all privileges ,can any one tell me what wrong in my query, i couldnt create table with the user.

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    4,995
    Mentioned
    100 Post(s)
    Tagged
    0 Thread(s)
    Did you do:

    FLUSH PRIVILEGES;
    After running the query to change the privileges?
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Addict goldensona's Avatar
    Join Date
    Jun 2011
    Posts
    226
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    i have run the above flush query but afterwards too i cant see grant all privileges



    Code:
    	User 	    Host 	Password 	Global privileges    	Grant 		
    	        general  localhost No      	USAGE 	                 No
    like this only i can see the

  4. #4
    SitePoint Enthusiast
    Join Date
    Jul 2007
    Location
    San Sebastian, Spain
    Posts
    93
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Firstly issuing the GRANT statement automatically FLUSHes the privileges, so you do not need to do this unless you update the mysql database tables directly. Also you need to be aware that you have created two separate logins above testuser@localhost and testuser@%. If you are logging in from the same host as the server then the testuser@localhost will be used. If you attempt to login from another host then the testuser@% will be used. I think that this is the source of your problem.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •