Error trying to use Prepared Statements - MySQL

Trying to execute a prepared statement:

 

SELECT [...] INTO @prepared
FROM [...] WHERE [...]

This part executes fine.

PREPARE stmt FROM @prepared;

This part also executes fine.

 

EXECUTE stmt;

 

This returns an error back:
 

Could not retrieve transation read-only status server

 

The first thing I found was this answer from Stackoverflow. They mention that this JDCB option should be set. Locally, I have it setup this way (using Datagrip), and it works.
 

useServerPrepStmts=false
Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like Follow
  • 4 mths agoLast active
  • 98Views
  • 1 Following

Create A New Discussion

Share your thoughts