This has probably been asked before, but I am struggling to find the answer.
Historically I have always installed MySQL (on Windows) from a template based on the mysql-xxx-win64.zip file.
I would basically
1) download the zip file,
2) copy the contents to the new location,
3) add in my template ini file,
5) add in my template mysql directory (with default users)
4) install a Windows Service,
5) start MySQL
This has worked fine for years (5.5 and earlier). But now I am starting to test 5.7, and I find that the zip file no longer contains a data directory?
If I try and create one by copying over from an existing database, I get an error.
Looking at the documentation I see that I am now supposed to initialize the data directory. But when I try this I get an error:
c:\MySQL\bin\mysqld.exe --initialize --user=mysql
mysqld: Can't change dir to 'C:\MySQL\DATA\' (Errcode: 2 - No such file or directory)
If I create the Directory it seems to work, but there is still no MySQL directory, so when I run mysql_upgrade or try and (start service then) login, it fails.
2016-05-16T09:03:16.222540Z 0 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist.
I found this post which says the password shouold be in the error log, but it isn't.
So, how am I supposed to install MySQL if they don't give us the data directory (and therefore mysql user etc. tables) anymore?
(and before someone suggests using the msi file - that's not an option as they are blocked on our network, and require me to jump through numerous hoops to even download it, let alone run it).
If I do: Copy MySQL Directory >> initialize >> install service >> start service, it seems to be ok, until I look in the error log and see that virtually every table has the wrong structure. But I can't run mysql_upgrade as I have no password, and mysql@localhost is access denied.
UPDATE: 2016-05-18
So I got hold of the MSI file, and (tried) to install using that. Eventually, I managed to get a copy of MySQL 5.7 installed and running. So now I need to install a second copy. The MSI installer fails at this point as I 'already have a copy installed', with no option that I can see to install another copy.
So I copied the MySQL Directory to a new folder, removed the DATA directory, updated the ini file, and ran c:\Mysql\...\mysqld.exe --initialize.
That re-created the DATA directory for me.
I then set it up as a Service c:\Mysql\....\mysqld.exe --install MySQL57-2 --defaults-file=c:\MySQL\...\my.ini
I got the temporary password from the error log, and tried to log in, only to be told ERROR 1130 (HY000): Host '::1' is not allowed to connect to this MySQL server.
So I stopped the service, started Mysqld using --skip-grant-tables, logged in, added a new user, logged out, restarted the service. But still can't log in.
If it's going to be this much hassle every time I need to install a new Database, I think I'll just stick to 5.5.