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.
Check your real my.ini
file location and set --defaults-file="location"
with this command
mysql --defaults-file="C:\MYSQL\my.ini" -u root -p
This solution is permanently for your cmd Screen.
What I did (Windows 10) for a new installation:
Start cmd in admin mode (run as administrator by hitting windows key, typing cmd, right clicking on it and selecting "Run as Administrator"
Change into "MySQL Server X.Y" directory (for me the full path is C:\Program Files\MySQL\MySQL Server 5.7")
using notepad create a my.ini with a mysqld section that points at your data directory
[mysqld]
datadir="X:\Your Directory Path and Name"
created the directory identified in my.ini above.
change into bin Directory under server directory and execute:
mysqld --initialize
Once complete, started the service and it came up fine.