Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have launched an application on a shared server but I cannot INSERT any data. I thought maybe I don't have privileges so I did SHOW GRANTS in my application then die()

The result was [ EDITED ]:

  [Grants for gigfa_11863212@%] => GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, LOCK TABLES ON `gigfa_11863212_life_journal`.* TO 'gigfa_11863212'@'%'
  [Grants for gigfa_11863212@%] => GRANT USAGE ON *.* TO 'gigfa_11863212'@'%' IDENTIFIED BY PASSWORD '*78839FD7FF9639FB72CCB5E9D8BCD81A7A0A9E3D' WITH MAX_QUERIES_PER_HOUR 80000 MAX_UPDATES_PER_HOUR 60000 MAX_CONNECTIONS_PER_HOUR 20000

Why do I get the following error message when I issue an INSERT statement?

< INSERT command denied to user 'user'@'host' for table 'table' >

share|improve this question
    
When you connect to the database, please run the following query: SELECT USER(),CURRENT_USER(); and tell us the output of this query. –  RolandoMySQLDBA Dec 3 '12 at 16:08
add comment

migrated from stackoverflow.com Dec 3 '12 at 2:43

This question came from our site for professional and enthusiast programmers.

2 Answers

You have granted usage to user@% but all other things to usr@%.

share|improve this answer
    
i just replaced my actual user_name and host_name with usr .. the one you saw was just a missed-type! :) –  dariush Dec 3 '12 at 0:36
    
Miss-type? Copy+Paste will prevent that. :) –  GolezTrol Dec 3 '12 at 1:05
    
add the exact result of SHOW GRANTS when logged in with that user. Also include the exact insert command and error message. We need to be able to confirm you're doing what you think you are. –  Gavin Towey Dec 3 '12 at 1:11
    
@Gavin: To show EXACT result of SHOW GRANTS the main question is edited. To show the EXACT INSERT command, right now i don't have access to my codes! i post them ASAP –  dariush Dec 3 '12 at 15:39
    
Are you connecting from localhost or another host? –  Ilion Dec 3 '12 at 16:03
show 1 more comment
up vote 0 down vote accepted

I am totally stupid ...

I my entire project which designed and developed locally and code-line's count reaches about 15000 lines, I just mentioned my local database JUST one time in my entire project! and see the result of that!!! I have been down for this about 24 hours!

Thank you all guys for trying to help

cheers

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.