#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2008
    Posts
    3
    Rep Power
    0

    Unhappy Error: INSERT command denied to user 'user_name'@'localhost' for table 'table_name'


    I've made my own customized admin panel to edit tables. The script worked fine on my localserver(wamp) but is showing this error when i try to update or insert a record ...select and delete is working fine..

    Have used same function for update, delete, and insert

    If anything is unclear please ask me..
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2005
    Posts
    454
    Rep Power
    60
    You need to grant insert privileges to user_name@localhost
    as admin user in mysql - or a user with grant pivileges:

    grant insert on database.* ( or database.table) to 'user_name'@'localhost' identified by 'password'


    Originally Posted by hasnainwasaya
    I've made my own customized admin panel to edit tables. The script worked fine on my localserver(wamp) but is showing this error when i try to update or insert a record ...select and delete is working fine..

    Have used same function for update, delete, and insert

    If anything is unclear please ask me..
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2008
    Posts
    3
    Rep Power
    0
    shopsinn_appe is my database and i want to grant access to all tables do i have to run some query using phpmyadmin. If yes can you tell me the query to run
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2008
    Posts
    3
    Rep Power
    0
    ok i mustard up this query

    grant select, insert, update, delete on shopsinn_appe.* to 'shopsinn_appe'@'localhost' identified by "appe";

    but when i ran it on phpmyadmin (sql)
    the following error was shown

    #1044 - Access denied for user 'shopsinn'@'localhost' to database 'shopsinn_appe'

    ...
    notice that i used shopsinn_appe as username but it returned shopsinn@ only....
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2005
    Posts
    454
    Rep Power
    60
    it's because you were logged into mysql as user shopsinn and user shopsinn doesn't have grant privileges. You need to be logged in as admin/root/or another user that has grant privileges.

    At this point this is a question for the mysql forum.


    Originally Posted by hasnainwasaya
    ok i mustard up this query

    grant select, insert, update, delete on shopsinn_appe.* to 'shopsinn_appe'@'localhost' identified by "appe";

    but when i ran it on phpmyadmin (sql)
    the following error was shown

    #1044 - Access denied for user 'shopsinn'@'localhost' to database 'shopsinn_appe'

    ...
    notice that i used shopsinn_appe as username but it returned shopsinn@ only....

IMN logo majestic logo threadwatch logo seochat tools logo