A few months ago, when I installed MySQL server on Windows 10 to run WordPress locally, I chose to have the database files on my main SSD drive. As it was slowly filling up, I decided to migrate the MySQL database files to another drive. I assumed all I needed to do is to update a path for datadir option in my.ini
configuration file, but that didn't work. After the database location move, starting the MySQL server gave me the 10061 error "Can't connect to MySQL server" error. Luckily, the fix was quite simple.
I got the following MySQL Workbench Connect error, when starting the MySQL server:
The MySQL Notifier's "Startup Message Log" contained the following:
Server start done.
Checking server status...
Trying to connect to MySQL...
Can't connect to MySQL server on 'localhost' (10061) (2003)
Assuming server is not running
As I mentioned, the datadir option in the main my.ini
configuration file didn't work, but I also found my.ini
file in the following path C:\ProgramData\MySQL\MySQL Server 5.7
. I fixed the datadir path there too, but that didn't do anything.
In the end, the solution for me was to reconfigure the MySQL Install.
Recovery Toolbox for MySQL
If you need to repair a corrupted or damaged MySQL database, why not try the Recovery Toolbox for MySQL tool to help recover tables, data, indexes, and keys of non-work MySQL databases.
To reconfigure the MySQL install, we do the following steps:
- In Start Menu, search for "mysql". Among the results, you should see the "MySQL Installer - Community". Run it.
Note: If you don't find it, open the Windows Explorer and find theMySQLInstaller.exe
file inside the following path for Windows 10:
C:\Program Files (x86)\MySQL\MySQL Installer for Windows\
- MySQL Installer window will show up as shown below. Find "MySQL Server" under Product and click on "Reconfigure" link.
- The MySQL Installer will show up (the same one you used for the first MySQL Server installation). Go through all the steps.
After the MySQL Installer was finished, I started the MySQL service again. This time, the "Startup Message Log" on The MySQL Notifier was showing that the server started successfully:
Server start done.
Checking server status...
Trying to connect to MySQL...
Connection succeeded
Assuming server is running
Conclusion
There are many suggestions on the web about how to solve the MySQL 10061 error. The one that worked for me was to run the MySQL Installer - Community and then choose "Reconfigure" for the MySQL server product. I hope you have found this article helpful. If you fixed this issue using another way, drop a comment and let us know.
Matt
January 3, 2018This has been helpful. Now to figure our why MySQL Installer hangs when checking root password.
Aldous Everard
December 9, 2019I am stuck at this stage. What is the 'Current Root Password'? How do I stop the process hanging at this stage?
Nkosiyapha
April 1, 2021I'm experiencing the same problem, how did you resolve yours?
Alexandra Vremeroiu
December 11, 2019hey, any solution of how to get through the password error?
admin
December 11, 2019Hi,
I had once this issue too, but I was unable to fix it without reinstalling the MySQL completely.
Nkosiyapha
April 1, 2021Meaning you had to uninstall other programs that came with it?
admin
April 1, 2021No, if I remember correctly, I ran "MySQL Installer" and had to remove "MySQL Server" product and then add it back.
akbakir
May 8, 2018Thanks, it's helpfull.
Bobby
June 1, 2018You're my hero.
sudhan
September 17, 2019yes he is correct
Xaim
June 5, 2018Thank you very much!
It was really helpful for me!
Korean
June 9, 2018Thank you
Addy
June 24, 2018Superb! Thanks for the detailed guide. Apt & accurate!
Cristian
July 29, 2018Thanks! This method was simple to follow and solved the issue fast!
Raul Rivero Rios
August 27, 2018Thanks so much men, hello from Mex!
Kevin
September 11, 2018Thanks man. This worked.
Chris
November 8, 2018Spent an entire morning searching Google, trying to get Visual Studio to connect to my MySQL server and to no avail. Followed your instructions and it solved my issues first time.
Thanks for sharing!
Memed
November 9, 2018Thank you very much!
jhona
November 15, 2018Thanks a lot dude it worked. I was trying this for 2 days and was about to give up when i decided to try your solution
sharon
December 24, 2018Very helpful, thx!
Anand Banse
January 3, 2019I follow procedure its show error message
" Configuration of MySql 5.7.22 is taking longer than expected. Do you want to continue waiting or cancel the configuration"
I tried lot of times.
Help me
Luigi.hu
March 14, 2019It was very helpful. Thank you very much!
I have only one question. How did this problem happen? I tried a new spring boot example at last time...
Al
March 16, 2019Hi all
Well .. I tried your solution BUT I am stuck because MySql does not "know" my password anymore (SIC!!)
Anyone help me to find how and where can i fix that problem.
Thank you all.
admin
March 16, 2019Hi,
I had same issue when installing MySQL 8 a week ago. When going to reconfigure, the middle step of configuration asked for password, but it didn't get recognized for some reason, so I never managed to get to the next step. In the end, I made a backup of databases, removed the MySQL server and reinstalled it.
I'm not sure why this happened, but I do remember I was having trouble making WordPress to work due to MySQL 8 using the new the password authentication method, so I was modifying the value of default_authentication_plugin setting in the
my.ini
file. Maybe this caused the issue in the first place.Alice
April 6, 2019Very helpfull...thanks!!
Ranbeer Kumar
May 31, 2019It's work but I close my sql and again reopen the my sql then server may not be connected plz solve the issue
Unmesh Kumar
June 5, 2019Thanks mate, finally resolved the error. Searched Google and read documentation of MySQL, still was not able to resolve it. But your solution worked.
ADISU
July 8, 2019It works
thank you very much
Devin
August 28, 2019Thanks so much.
Kutaro
September 17, 2019It works!
Tony from Nairobi
October 28, 2019Worked wonders here too.
Diz
December 9, 2019Thanks.. That was helpful
Aa
January 12, 2020many thanks it worked for me
thanks again
Slots
January 22, 2020Thanks.
Meredith
August 14, 2020Thank you this worked for me instantly!!
C
September 10, 2020This saved my day! Thank you so much for sharing.
Randy
December 17, 2020Thank you! This helped me
Lakshmi
December 25, 2020This worked for me too. Thank you so much.
Your love
January 21, 2021Love you man.
Aayusmita
February 3, 2021Thanks a lot, it helped.
me
February 12, 2021In Start Menu, search for "mysql" didn't do anything
admin
February 13, 2021Hi,
Try finding the file in Windows Explorer. For Win10, I have it at:
C:\Program Files (x86)\MySQL\MySQL Installer for Windows\MySQLInstaller.exe
Dipesh
September 9, 2021Thanks, it worked.
Divyank
February 7, 2022Dhaynawaad..! Thank You..