0

I handle a server about SQL operating,it receive data from another server.

The issue is if the forward server pass wrong target table or column to insert data,my server will shut down and throw error code "ER_NO_SUCH_TABLE". I can't catch that error.

update data just throw error but won't shut down that I could do some error handling and server didn't stop.

How can I set up to make server doesn't stop when occur ER_NO_SUCH_TABLE. Thank you!!

KaiLee
  • 27
  • 1
  • 4
  • Can you please share you code here so that we can take a look how currently you are doing error handling ? – Vipulw Jan 15 '22 at 09:48
  • You can check if the table exists before attempting insert, see https://stackoverflow.com/a/8829109/5250309 – prasgl Jan 15 '22 at 09:52
  • This is impossible to answer without further context. I suppose you have a Node based HTTP server (I can't conceive a way to crash MySQL server with such a query). Does it run a single process (as opposed to forking for requests)? Is there a watcher to restart dead servers? Are you positively sure that your DB library won't allow to catch query errors, or you mean you don't maintain the app and this is a sysadmin question? – Álvaro González Jan 15 '22 at 12:35

0 Answers0