Introduction
While working with Magento 2, you might encounter the following error in your system.log
:
“main.ERROR: mysql2 search engine doesn’t exist. Falling back to mysql [] []”
This blog post will guide you through a simple fix to resolve this error.
Understanding the Error
The error indicates that Magento is trying to use a non-existent search engine configuration, specifically mysql2
, and is falling back to the default mysql
engine.
Solution: Update Configuration Settings
Follow these steps to fix the error by updating the configuration settings in Magento 2:
Step-by-Step Guide
1. Access Catalog Configuration
Navigate to Stores > Configuration > Catalog > Catalog in the Magento admin panel.
2. Update Catalog Search Settings
In the “Catalog Search” section:
- Ensure “Search Engine” is set to
MySQL
. - Tick the checkbox for “Use system value” if it’s not already selected.
This adjustment ensures that Magento uses the correct search engine configuration.
Alternative Solution: SQL Query
If you prefer or need to update the configuration directly in the database, you can run the following SQL query:
UPDATE core_config_data SET value = 'mysql' WHERE path = 'catalog/search/engine';
This query updates the search engine setting in the core_config_data
table to use mysql
.
Conclusion
By following these steps, you can resolve the “mysql2 search engine doesn’t exist” error in Magento 2. Whether you choose to update the settings through the Magento admin panel or directly via SQL, this will ensure your search engine configuration is correct.
Further Assistance
If you have any questions or encounter any issues, feel free to leave a comment below or reach out for further support.