I've been going through upgrade hell changing to MySQL 8.0 on my W10 machine. Long story short, after difficulty upgrading the normal way I uninstalled the previous version and traces of it in Program Files, ProgramData, and Users[user]\Roaming\MySQL and did a fresh install of 8.0.x (latest version).
After the install the service started and worked fine. After a reboot, the service won't start and I get the "MySQL service on Local Computer has started and then stopped." error.
I have been through the fixes suggested in this thread, but the service still won't start. If I try to start the daemon manually I get:
C:\Users\boss>mysqld
2020-01-18T15:54:14.346428Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.19) starting as process 9236
2020-01-18T15:54:14.352531Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2020-01-18T15:54:14.352672Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\mysqld_tmp_file_case_insensitive_test.lower-test
2020-01-18T15:54:14.353206Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno: 2 - No such file or directory)
2020-01-18T15:54:14.368554Z 0 [ERROR] [MY-010119] [Server] Aborting
2020-01-18T15:54:14.368725Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.19) MySQL Community Server - GPL.
There is a data folder under \ProgramData\MySQL Server 8.0 but not under \Program Files\MySQL\MySQL Server 8.0. I found another thread that suggested a fix by running mysqld --initialize but it also implied you don't need the folder under Program Files if you're running as a service, so I'm not sure this is the problem and don't want to make a change that will screw things up even more.
Can anyone advise me how to troubleshoot this?
UPDATE. Looking in the logfile I find error: "Fatal error: Could not read the column 'authentication_string' from table 'mysql.user'. Please perform the MySQL upgrade procedure." Now I think I know what happened. I installed the new version then read a dump file from the old version. That was a dump of the entire DB so when the server started and I restored this, it overwrote the mysql.user file. Question is, what can I do about this now? I can reinstall but how to I restore everything besides mysql.user from the dump file?