I opted out of using installer option as it has no option to pick up the directory where you want MySQL installed. It always ends up under 'Program Files' in Windows, which didn't work for me because of my company security policies.
So I went ahead with downloading the zip file and uncompromising where I wanted. I found various instructions on how to install but didn't work out smoothly - what's new!
So here is how it worked for me.
1. Extract the content of the zip file where you want it.
2. Create 'data folder' where your MySQL data will reside. It could be anywhere. Named mine 'MySQLdata'
3. Create option file named my.ini . This file is used on startup of the MySQL server to set up some initialization parameters. Location of the data folder is one of them.
Mine looked like that:
[mysqld]
# installation directory
basedir="C:\mysql-5.7.18-winx64\"
explicit_defaults_for_timestamp
# data directory
datadir="C:\\MySQLdata\"
explicit_defaults_for_timestamp - Added this as on startup the server was giving me TIMESTAMP error. This setup took care of it.
4. Open cmd window and go to mysql-5.7.18-winx64\bin -> run
mysqld --initialize-insecure
This will initialize MySQL server and will not generate random password for the root user.
5. From a different cmd window go to mysql-5.7.18-winx64\bin -> run mysql -u root
this will log you as root. No password is required.
6. Set up root password:
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
7. Create other user as needed.
From this point on MySQL Server is ready to go. You can configure it as Windows service
x