terrymanu commented on issue #36966:
URL:
https://github.com/apache/shardingsphere/issues/36966#issuecomment-3471186959
## Problem Confirmation
The issue you're encountering is a protocol version mismatch when
ShardingSphere-Proxy tries to be compatible with both MySQL 5 and MySQL 8
simultaneously.
## Root Cause Analysis
Core Issue: The query_cache_size system variable has been removed in MySQL
8.0, but ShardingSphere-Proxy currently uses MySQL 5.7.22 protocol for
communication by default.
From the source code analysis, the `MySQLProtocolDefaultVersionProvider`
class returns version "5.7.22" by default. When connecting to MySQL 8, the
Proxy attempts to query system variables that no longer exist in MySQL 8,
causing connection failures.
## Compatibility Statement
Theoretical Support: ShardingSphere is designed to support both MySQL 5
and 8, but in practice, you need to consider:
- The protocol version used by Proxy determines communication with backend
databases
- Different MySQL versions support different sets of system variables
- JDBC driver compatibility also affects connection success rate
## Solution Recommendations
Option 1: Version Selection Strategy
- If primarily using MySQL 8, consider upgrading to a configuration that
supports MySQL 8 protocol
- If you need to support both versions simultaneously, consider using a
protocol version that offers better compatibility
Option 2: Architecture Adjustment
- Deploy separate Proxy instances for different MySQL versions
- Avoid having a single Proxy handle multi-version compatibility issues
Option 3: Driver Configuration
- Ensure you're using a JDBC driver version that supports MySQL 8
- Verify that your connection string configuration is correct
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]