<p>MySQL raises Error 1651 when the server’s query cache is turned off but a statement or tool tries to access it.</p>
<p>MySQL Error 1651 ER_QUERY_CACHE_DISABLED means the query cache subsystem is off. Edit my.cnf to set query_cache_type=1 and query_cache_size>0, then restart MySQL to resolve the issue.</p>
Query cache is disabled; restart the server with
MySQL throws Error 1651 with the message 'Query cache is disabled; restart the server with query_cache_type=1 to enable it' when it detects that the query cache subsystem is inactive yet referenced by a statement or monitoring tool.
The error is informational but blocks cache-related operations such as SHOW STATUS LIKE 'Qcache%'. It normally appears right after server start or during performance checks.
A global setting of query_cache_type=0 or query_cache_size=0 disables the cache. MySQL then refuses any cache interaction and emits the 1651 code.
The error is common after upgrading to MySQL 8.0, where the query cache feature was removed entirely. Legacy configuration lines or scripts still referencing it will fail immediately.
For MySQL 5.7 or earlier, edit my.cnf to set query_cache_type=1 and allocate a positive query_cache_size, then restart the server.
For MySQL 8.0 and later, delete all query cache variables from configuration files and code. Adopt indexing, query rewrites, or external caches like Redis for performance instead.
Migration scripts that call RESET QUERY CACHE stop with this error. Wrap such commands in a version check or remove them for MySQL 8.0.
Monitoring tools querying Qcache metrics on a disabled server will spam logs. Update tool settings to skip cache metrics or re-enable the cache.
Maintain consistent configuration across environments so query_cache_type and query_cache_size values match. Validate during CI using SHOW VARIABLES.
Run mysql_upgrade before version changes and scan for deprecated parameters. Document performance requirements early to select the right caching strategy.
Error 1630 FUNCTION NOT FOUND may appear after upgrades that drop unused plugins. Verify functions before updates.
Error 1203 Too many connections signals insufficient max_connections. Increase it and monitor usage.
Setting query_cache_type=0 forces MySQL to bypass the cache, triggering Error 1651 whenever cache operations are requested.
A query_cache_size of 0 allocates no memory, effectively disabling the cache and causing the error.
The query cache was removed in MySQL 8.0. Any remaining references immediately raise Error 1651.
Maintenance scripts that call RESET QUERY CACHE on a server where the cache is off will receive the error.
Raised when a stored procedure is missing or misspelled. Create or correct the procedure.
Occurs when a user exceeds the allowed connections. Increase max_user_connections or optimize pooling.
Indicates the connection was lost due to timeouts or packet limits. Adjust wait_timeout and max_allowed_packet.
No. MySQL 8.0 removed the feature entirely. You must remove related settings and use alternative caching strategies.
Generally no. Heavy writes cause frequent cache invalidation, reducing benefit. Rely on indexes and application-level caching instead.
Monitor Qcache_hits and Qcache_inserts after enabling the cache. A high hit ratio indicates benefit.
Yes. Galaxy’s editor lets you run SHOW VARIABLES and share results with your team, ensuring everyone sees the same configuration.