update command is denied for user
As everyone else said, it's permission issue. I am sure you probably checked, but just in case. After you log into phpmyadmin, run the following:
SELECT USER();
That should spit out 'test'@'localhost' as indicated in all the comments above
Then run
SHOW GRANTS FOR 'test'@'localhost'
That should give you all privs for that user. When you get results, select 'Options', Full Text and click go to get full text.
Make sure permissions in the output have something like that:
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `your_database`.* TO 'test'@'localhost'
You might not be able to get GRANT ALL on some hosting setups but as long as you got INSERT, UPDATE, DELETE you should definitely be able to update the data
For everyone who have tried answering this question here is my sincere thanks. I have found the problem and solution.
my sql query is like this
UPDATE `dblayer`.`test` SET `title` = 'hello a' WHERE `test`.`id` =1;
which I got from phpmyadmin and it works perfectly on my system. But when I work on the servers it doesn't work and it says command denied may be because
`dblayer`.`test`
I am trying to select the table globally (or something like that, I'm not sure) but if my sql query is
UPDATE `test` SET `title` = 'hello a' WHERE `test`.`id` =1;
it works on my server too.
Your user doesn't have the right permissions. You need to give it access to the UPDATE command, like so:
GRANT UPDATE ON database.* TO test@'localhost' IDENTIFIED BY 'password';
If you are using a graphical tool to manage the database - e.g. PHPMyAdmin or SQLYog, etc - you should be able to use those tools to enable these permissions too.