I installed a MySQL server with installer and it started. After reboot I tried to start it again and get the error:
D:\\Program Files\\MySQL\\MySQL Server 5.
This solution uses the windows mysql installer.
I have tried every other way mentioned here and other related posts, but it did not solve my problem, the service just wont start, but the below approach with the mysql-installer did.
If you still have your installer or atleast remember the version then follow below steps:
You can check from the window's services that the MySqL Server has started.
Hope it helps someone.
In mysql 8.0.13 zip package initializing.
Verify that data folder is empty.
Under the mysql bin path run
mysqld.exe --initialize-insecure
Add to my.ini native mysql
[mysqld]
default_authentication_plugin=mysql_native_password
In my case, I had installed the data directory to a different location. So the data directory really wasn't in the default location. Therefore, when I ran the mysqld
command from the command prompt, I had to specify the data directory manually:
mysqld --datadir=D:/MySQLData/Data
Here's the documentation for mysqld command-line arguments.
Since you used the Windows installer, everything is set up for you to run MySQL 5.7 as a Windows service, which is a great option in most cases.
Instead of running mysqld.exe
from the command line,
Win + R
services.msc
MySQL57
If this is stil not working try having the following notation with double slashes: C:\WebSerer\MySQL\data or C:/WebServer/MySQL/data
Check for missing folders that are required by the server, in my case it was UPLOADS folder in programData which was deleted by empty folder cleaner utility that I used earlier.
How did I find out:
run the server config file my.ini(in my case it was in programData) as the defaults-file param for mysqld (don't forget to use --console option to view error log on screen) 'mysqld --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console'
Error:
mysqld: Can't read dir of 'C:\ProgramData\MySQL\MySQL Server 8.0\Uploads\' (OS errno 2 - No such file or directory)
Solution:
Once I manually created the Uploads folder the server started successfully.