Bug #89382 Windows Installer cannot complete configuration
Submitted: 24 Jan 2018 13:21 Modified: 9 Apr 2018 13:30
Reporter: Peter Laursen (Basic Quality Contributor) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL for Windows: Installer Severity:S2 (Serious)
Version:8.04 OS:Windows
Assigned to: CPU Architecture:Any

[24 Jan 2018 13:21] Peter Laursen
Description:
Windows Installer cannot complete configuration of MySQL 8.04. It stops at 'applying security settings'. 

How to repeat:
Just do a fresh install of 8.04 from inside the Installer and see error occur during configuration. 

The CLI from the 8.04 package can connect, but the server runs with an empty password for 'root'@'localhost' user

Suggested fix:
I think I understand that MySQL 8 from 8.04 uses a new authentication plugin (caching_sha2_password). It looks like the client code in the Installer does not support this plugin, thus cannot connect and thus cannot update the 'user' table. 

As far as I know the Installer is a .NET program and if I am right, the .NET-connector should be updated and the updated version should be included with the installer.

So - again if I am right - it is a 'matter of taste' if this bug is a bug with the Installer, the connector or both.
[25 Jan 2018 10:13] Peter Laursen
https://mysqlserverteam.com/mysql-8-0-4-new-default-authentication-plugin-caching_sha2_pas...

"Support for caching_sha2_password was added in MySQL 8.0.3. Older versions of libmysqlclient do not support this plugin. So, although client tools that use libmysqlclient older than one available with MySQL 8.0.3 can connect to MySQL 8.0.4 server using users that use other authentication plugins such as mysql_native_password or sha256_password, such client cannot connect to MySQL 8.0.4 server using users which require caching_sha2_password support. For an upgraded database, it means connecting using an existing user account should not face any issues."

IMO it is *very bad timing* to release a server with such important change before connectors, tools and clients are ready for it.
[29 Jan 2018 6:19] Chiranjeevi Battula
Hello Peter,

Thank you for the bug report.
I could not repeat the issue at our end using Windows Installer with 1.4.23 and  MySQL 8.0.4 server version.
Could you please provide repeatable steps (exact steps, Installer verion, log  etc. - please make it as private if you prefer) to confirm this issue at our end?

Thanks,
Chiranjeevi.
[29 Jan 2018 6:56] Chiranjeevi Battula
Screenshot

Attachment: Bug_89382.PNG (image/png, text), 30.94 KiB.

[29 Jan 2018 9:00] Peter Laursen
Was it a fresh install you did?

If you have upgraded from a previosu version, then the root@localhost user will not use this new authentication plugin.
[29 Jan 2018 9:03] Peter Laursen
If you have a previos 8.x version you must uninstall and when doing so you must choose to delete the /datadir in "ProgamData" folder (or delete manually)
[29 Jan 2018 10:28] Chiranjeevi Battula
Yes Peter, I did fresh installation and I have tested couple of times.
[29 Jan 2018 10:29] Chiranjeevi Battula
Screenshot

Attachment: Bug_89382_1.PNG (image/png, text), 33.96 KiB.

[29 Jan 2018 11:09] Peter Laursen
image - explanation will follow

Attachment: configure.PNG (image/png, text), 48.40 KiB.

[29 Jan 2018 11:21] Peter Laursen
I tried again. This timne the interface says it could not start service, but in reality it did. Se in the console that service is running. Last time it was the next step ("apply security settings") that displayed a red "X". 

The server is running with an empty password for 'root'@'localhost user as before. The root user is authenticated with the new caching_sha2_password plugin.

I simply opened the Installer .. selected "remove" .. identified the MySQL 8 server .. uninstalled .. confirmed that I wanted to delete the data folder, rebooted the system as the Installer prompted me to do, and before doing anything else on this system I ran the Installer and installed MySQL 8.0.4.

The MySQL 8.0.4 binary in the MySQL Installer's "product cache" was downloaded by the Installer the same day as I opened this bug report.  Any chance that the file on the server was replaced in between (bad versioning practice if it was!) ?
[29 Jan 2018 11:24] Peter Laursen
Installer version is 1.4.23.0.
[29 Jan 2018 11:59] Peter Laursen
I tried to delete the 8.0.4 .mis from the Installer's "Product cache" in order to get a fresh file. Same result as before. THe log from the config wizard:

Beginning configuration step: Stopping Server [if necessary]
Ended configuration step: Stopping Server [if necessary]

Beginning configuration step: Writing configuration file
Ended configuration step: Writing configuration file

Beginning configuration step: Updating firewall
Attempting to create firewall rule with command: netsh.exe  firewall delete portopening protocol=TCP port=3306 profile=ALL
Adding firewall rule for MySQL80 on port 3311.
Attempting to create firewall rule with command: netsh.exe  firewall add portopening protocol=TCP port=3311 profile=ALL name=MySQL80 mode=ENABLE scope=ALL
Unexpected response from netsh:
Could not run process.
Attempting to create firewall rule with command: netsh.exe  advfirewall firewall add rule name="Port 3311" protocol=TCP localport=3311 dir=in action=allow
Successfully added firewall rule.
Ended configuration step: Updating firewall

Beginning configuration step: Adjusting Windows service [if necessary]
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Adding new service
New service added
Ended configuration step: Adjusting Windows service [if necessary]

Beginning configuration step: Initializing Database [if necessary]
Deleting the data directory from a previous (failed) configuration...
Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.4...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on...
2018-01-29T11:54:41.347617Z 0 [Warning] [MY-011071] option 'read_buffer_size': unsigned value 0 adjusted to 8192
2018-01-29T11:54:41.347658Z 0 [Warning] [MY-011071] option 'read_rnd_buffer_size': unsigned value 0 adjusted to 1
2018-01-29T11:54:41.347730Z 0 [Warning] [MY-010915] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-01-29T11:54:41.347792Z 0 [System] [MY-010116] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.4-rc-log) starting as process 10036 ...
2018-01-29T11:54:45.489094Z 0 [Warning] [MY-010068] CA certificate ca.pem is self signed.
2018-01-29T11:54:45.835755Z 5 [Warning] [MY-010453] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
Process for mysqld, with ID 10036, was started successfully and exited with code 0.
MySQL Server 8.0.4 intialized the database successfully.
Ended configuration step: Initializing Database [if necessary]

Beginning configuration step: Starting Server
Attempting to start service MySQL80
An error occurred while trying to start the MySQL Server instance.
Ended configuration step: Starting Server

.. but that is not correct. THe server is started. I can login as root:

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -uroot --port=3311
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 8.0.4-rc-log MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
[29 Jan 2018 12:15] Peter Laursen
".msi" .. not ".mis" .. I meant!
[30 Jan 2018 12:07] Chiranjeevi Battula
Hello Peter,

Thank you for your feedback.
I could not repeat the issue at our end using Windows Installer 1.4.23 and  MySQL 8.0.4 server in Windows 10 / 7.

Thanks,
Chiranjeevi.
[6 Apr 2018 9:47] Peter Laursen
THis may be related
https://bugs.mysql.com/bug.php?id=89411
[9 Apr 2018 13:30] Peter Laursen
Configurator log: 

Beginning configuration step: Stopping Server [if necessary]
Ended configuration step: Stopping Server [if necessary]

Beginning configuration step: Writing configuration file
Ended configuration step: Writing configuration file

Beginning configuration step: Updating firewall
Attempting to create firewall rule with command: netsh.exe  firewall delete portopening protocol=TCP port=3306 profile=ALL
Adding firewall rule for MySQL80 on port 3311.
Attempting to create firewall rule with command: netsh.exe  firewall add portopening protocol=TCP port=3311 profile=ALL name=MySQL80 mode=ENABLE scope=ALL
Unexpected response from netsh:
Could not run process.
Attempting to create firewall rule with command: netsh.exe  advfirewall firewall add rule name="Port 3311" protocol=TCP localport=3311 dir=in action=allow
Successfully added firewall rule.
Ended configuration step: Updating firewall

Beginning configuration step: Adjusting Windows service [if necessary]
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Adding new service
New service added
Ended configuration step: Adjusting Windows service [if necessary]

Beginning configuration step: Initializing Database [if necessary]
Deleting the data directory from a previous (failed) configuration...
Attempting to run MySQL Server with --initialize-insecure option...
Starting process for MySQL Server 8.0.4...
Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on...
2018-04-09T13:04:07.922569Z 0 [Warning] [MY-011071] option 'read_buffer_size': unsigned value 0 adjusted to 8192
2018-04-09T13:04:07.922608Z 0 [Warning] [MY-011071] option 'read_rnd_buffer_size': unsigned value 0 adjusted to 1
2018-04-09T13:04:07.922666Z 0 [Warning] [MY-010915] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2018-04-09T13:04:07.922710Z 0 [ERROR] [MY-010177] Can't start server: Invalid value for --default-authentication-plugin
2018-04-09T13:04:07.923248Z 0 [ERROR] [MY-010119] Aborting
Process for mysqld, with ID 1448, was started successfully and exited with code 1.
Database initialization failed.
Ended configuration step: Initializing Database [if necessary]

I checked the my.ini generated and it reads 

..
default_authentication_plugin=0.0
.. 

Installer version is 1.4.23.0