Note. The steps given here are for Linux only, you can use a different OS and then use the appropriate editor and commands
MySQL stores the error message file in /usr/share/mysql/english/errmsg.sys , where english is the language you want to use.
Note. You must have superuser privileges
Step 1. Make a backup of your existing errmsg.sys (so you can come back if there is any problem
$sudo cp /usr/share/mysql/english/errmsg.sys ~/errmsg.sys.bkp
Step 2. Open /usr/share/mysql/english/errmsg.sys in vi editor.
$sudo vi /usr/share/mysql/english/errmsg.sys
Step 3. Find "You Have" in the errmsg.sys file
in vi editor for searching try this way--> /You have an [press enter]
This will lead you to the line "You have an error ..." as shown on the screen. 
Step 4. Edit this error message to suit your needs. I deleted the line You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the and saved only right syntax to use
Check out the screenshot. 
Step 5. Save and exit.
in vi editor to save and exit--> :x! [press enter] here ! is added to override read-only file
Step 6. Restart the mysql service.
$sudo mysql restart
step 7. check the error message (I check phpMyAdmin)

In this answer, I updated the error message You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near... You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near... , you can also update another standard error message.
Hope this helps !: D
Ravi Dhoriya ツ
source share