How to resolve "mysql Proxy Warning - Syntax Forbidden prepare"? #2538
Replies: 5 comments 1 reply
-
hi @Q5EbA7Vdyw84efER what is your mysql server? |
Beta Was this translation helpful? Give feedback.
-
It's a MYSQL service bind a proxy, which port is not 3306, now I've got it worked by changing the .execute() to .query(), refered to your post in 2016 #476 (comment). |
Beta Was this translation helpful? Give feedback.
-
The reason is that query passed to So it'll probably be something like |
Beta Was this translation helpful? Give feedback.
-
I did several tests in both direction connection to MYSQL and connection to a proxy(MYSQL is behind the proxy, this will bring some problem) 1.The prepare SQL in direction connection environment shows as below mysql> PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse'; mysql> SET @A = 3; mysql> SET @b = 4; mysql> EXECUTE stmt1 USING @A, @b; 2.proxy environment, I can't connect it successfully by cli tool(which always prompted wrong password), so I switched to the Jetbrain Datagrip tool, but driver MYSQL in Datagrip also failed(prompted "[08001] CLIENT_PLUGIN_AUTH is required"), then I tried some workaround and found that driver MYSQL5.1 in Datagrip can get it connected. Then I tried the same prepare SQL in direction connection test. 3.I also tried using Datagrip tool in direction connect environment, input below commands and it worked successfully, I got the result 5, sqrt(pow(3,2)+pow(4,2))=5, the output record is below 4.I tried another time to the proxy using Datagrip, I found that the lower right corner collation popup is only a warning, which didn't blocked the command, so the first command PREPARE stmt1 FROM 'SELECT SQRT(POW(?,2) + POW(?,2)) AS hypotenuse'; had executed successfully, but the second command SET @A = 3; failed and told me 'Proxy Warning - Syntax Forbidden', the intact output record is below. I asked the DBA workmate and she said that the proxy environment doesn't support such SQL. |
Beta Was this translation helpful? Give feedback.
-
Maybe, but whatever I will and have to use .query() function in the later coding and continously be deep into the heavy work of my company and from my boss. |
Beta Was this translation helpful? Give feedback.
-
I'm using Nextjs framework, and wrote my code as a function as below
Everything is OK in test environment, but in our company's production MYSQL environment, it didn't work and output such log error
Beta Was this translation helpful? Give feedback.
All reactions