I create a mysql database using CPanel on a shared hosting server ... i have given privileges of CREATE, UPDATE, DELETE, INSERT to the user, what privilege should i give to use the REPLACE syntax .... available privileges (as you might already know)... ALTER, CREATE ROUTINE, CREATE VIEW, DROP, INDEX, LOCK TABLES, SELECT, UPDATE, CREATE, CREATE TEMPORARY TABLES, DELETE, EXECUTE, INSERT, REFERENCES, SHOW VIEW ... but i could not find the REPLACE privilege ... as this is my first experience on online server .... i have no clue please help ... :)
Asked
Active
Viewed 69 times
1 Answers
4
Quoting the manual page for replace
:
To use
REPLACE
, you must have both theINSERT
andDELETE
privileges for the table.
Which makes sense, considering that replace can do either a simple insert
, or a delete
and then an insert
(if the first insert failed because a duplicate-key error occured).

Pascal MARTIN
- 395,085
- 80
- 655
- 663
-
You can almost always use `INSERT IGNORE ... ON DUPLICATE KEY` instead of `REPLACE INTO`. – tadman May 18 '12 at 05:54
-
i have already given INSERT and DELETE privilege to the user before posting this.. – Kold May 18 '12 at 06:44