Root Cause of the Error:
This issue mainly occurs when multiple versions of MySQL are installed on the machine, causing conflicts within the database. Additionally, there are conflicts with the SQL Connector based on the database available on the system.
Solution:
Before making any changes, it's crucial to back up your MySQL database. Save the backup to a secure location.
Process 1 → If no other software is using MySQL database :
- Open the Control Panel and go to "Add/Remove Programs" (Windows) or "Programs and Features" (Windows 10/11).
- Locate MySQL (version higher than 4.0.13 or any other version) in the list of installed programs and uninstall it.
- After uninstallation, ensure that all MySQL services are stopped and removed:
- Press Win + R, type services.msc, and press Enter.
- Locate any MySQL-related services (e.g., MySQL, MySQL Server, MySQL56) in the list.
- Stop and disable these services by right-clicking on each service, selecting "Stop," and then "Properties" to set the startup type to "Disabled."
- Use the "C:\mysql\bin\winmysqladmin.exe" tool to manage any remaining MySQL services:
- Open File Explorer and navigate to C:\mysql\bin.
- Double-click winmysqladmin.exe to launch the MySQL Administrator.
- Check for any remaining MySQL services and take appropriate actions (e.g., stopping or removing them).
Process 2 → If other software is using MySQL :
Change MySQL Port: To prevent conflicts with other software using MySQL, change the port number of your MySQL application (e.g., from 3306 to 3307).
Following these steps should resolve the connection issue and ensure the proper functioning of your MySQL server and application.