Bug #90383 MySQL 8.0.4 RC don't read my.ini section with service name on Windows
Submitted: 11 Apr 9:38 Modified: 28 Jul 10:38
Reporter: Dominique Ottello Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Windows Severity:S2 (Serious)
Version:8.0.4 RC/8.0.11/8.0.12 OS:Microsoft Windows
Assigned to: CPU Architecture:Any
Tags: my.ini not read

[11 Apr 9:38] Dominique Ottello
Description:
Hi,

MySQL 80.0.4 RC don't read my.ini options file and use all defaults options.

How to repeat:
Install from zip file into:
j:/wamp64/bin/mysql/mysql8.0.4/
my.ini file is into j:/wamp64/bin/mysql/mysql8.0.4/my.ini

Create data directory with command:
mysqld.exe --default_authentication_plugin=mysql_native_password  --initialize-insecure

Create service with command:
mysqld.exe --install-manual wampmysqld64

Start service: net start wampmysqld64

none of the directives in the my.ini file are taken into account.
We can, for example, change:
log-error-verbosity = 1
per
log-error-verbosity = 3
and restart the service, the MySQL log file is desperately empty.

And yet, mysqld.exe --verbose --help indicates well:
Ver 8.0.4-rc-log for Win64 on x86_64 (MySQL Community Server (GPL))
...
Default options are read from the following files in the given order:
C:\Windows\my.ini C:\Windows\my.cnf C:\my.ini C:\my.cnf j:\wamp64\bin\mysql\mysql8.0.4\my.ini j:\wamp64\bin\mysql\mysql8.0.4\my.cnf
...
basedir                 j:\wamp64\bin\mysql\mysql8.0.4\ 
...
datadir                 j:\wamp64\bin\mysql\mysql8.0.4\data\

There is no my.cnf file on the whole system and the only my.ini file is the one indicated above.
[11 Apr 10:22] Miguel Solorzano
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

Thank you for your interest in MySQL.
[11 Apr 10:31] Dominique Ottello
It's not support, it's a bug!
The procedure as I described it works perfectly with all versions of MySQL including MySQL 5.7.21, but does not work with MySQL 8.0.4 RC while there was no problem with MySQL 8.0.3.
[11 Apr 10:35] Miguel Solorzano
Stop the server and then remove the service you created before. To read the my.ini create again the service as follows:

mysqld.exe --install-manual wampmysqld64 --defaults-file=j:/wamp64/bin/mysql/mysql8.0.4/my.ini
[11 Apr 16:37] Dominique Ottello
I'm sorry, but even with your solution, the my.ini options file is still not loaded, so its directives are not taken into account and MySQL 8.0.4 RC works with all its default options.
[11 Apr 16:45] Miguel Solorzano
There are another MySQL service on the same machine, i.e: for 5.7.21?
[11 Apr 18:09] Miguel Solorzano
Open a command prompt.
Be sure the service is stopped.
Be sure that the basedir and datadir are correct in the my.ini file.
Run the below command and print here the result:

mysqld --defaults-file=j:\wamp64\bin\mysql\mysql8.0.4\my.ini --standalone --console
[11 Apr 18:26] Miguel Solorzano
I am getting the below error:

D:\wamp64\bin\mysql\mysql-8.0.4>bin\mysqld --defaults-file=d:\wamp64\bin\mysql\mysql-8.0.4\my.ini --standalone --console
mysqld: Can't change dir to 'd:\wamp6in\mysql\mysql-8.0.4\data\' (Errcode: 22 - Invalid argument [OS Error Code : 0x7b])

On my test the issue is: wamp64\bin\ which is parsed as wamp6in, so I guess the \bin folder is interpreted as backspace \b. Just want to see why you didn't see this error. Thanks
[12 Apr 8:21] Dominique Ottello
Hi,

With my original my.ini file, there is:
J:\wamp64\bin\mysql\mysql8.0.4\bin>mysqld --defaults-file=j:\wamp64\bin\mysql\mysql8.0.4\my.ini --standalone --console
2018-04-12T07:55:22.796498Z 0 [System] [MY-010116] J:\wamp64\bin\mysql\mysql8.0.4\bin\mysqld.exe (mysqld 8.0.4-rc-log) starting as process 6464 ...
2018-04-12T07:55:24.715301Z 0 [Warning] [MY-010068] CA certificate ca.pem is self signed.
2018-04-12T07:55:24.746501Z 0 [System] [MY-010931] J:\wamp64\bin\mysql\mysql8.0.4\bin\mysqld.exe: ready for connections. Version: '8.0.4-rc-log'  socket: ''  port: 3306  MySQL Community Server (GPL).

Ctrl-C to quit

2018-04-12T07:57:18.595501Z 0 [System] [MY-0010^7C7] J:\wamp
64\J:\wamp64\bin\mysql\mysql8.0.4\bin>bin\mysql\mysql8.0.4\bin\mysqld.exe: Normal shutdown

2018-04-12T07:57:19.687503Z 0 [System] [MY-010910] J:\wamp64\bin\mysql\mysql8.0.4\bin\mysqld.exe: Shutdown complete.

--- Now, in my.ini file, I copy all directives from the [wampmysqld64] (name of the service) section under the [mysqld] section and restart the previous procedure

As message is in French : "Arr+┬Čt normal du serveur" this means that my directive "lc-messages=fr_FR" is well taken into account.

If now (leaving the copy of the [wampmysqld64] section in the[mysqld] section I run MySQL by starting the wampmysqld64 service, the log file (J:\wamp64\logs\mysql.log) is well filled:
2018-04-12T08:14:56.109759Z 0 [System] [MY-010116] j:\wamp64\bin\mysql\mysql8.0.4\bin\mysqld.exe (mysqld 8.0.4-rc) starting as process 8428 ...
2018-04-12T08:14:56.827360Z 0 [System] [MY-010931] j:\wamp64\bin\mysql\mysql8.0.4\bin\mysqld.exe: ready for connections. Version: '8.0.4-rc'  socket: ''  port: 3306  MySQL Community Server (GPL).

My conclusion is that the my.ini file is loaded when starting MySQL by the "wampmysqld64" service, but that it is the directives in the [mysqld] section that are taken into account and not the directives in the service name section [wampmysqld64] contrary to what has always been done from mysql 5.1. to mysql 5.7.21.
[12 Apr 11:49] Miguel Solorzano
Thanks for the feedback. I was able to verify that actually the server 8.0 don't read the my.ini section with the service name like i.e 5.7.21 does, that's important when running several instances on same machine with only one my.ini.

C:\mysql-8.0.4>type my.ini
[wampmysqld64]
basedir=c:\mysql-8.0.4
datadir=c:\mysql-8.0.4\data
port=4040
C:\mysql-8.0.4>bin\mysqld --install-manual wampmysqld64 --defaults-file=c:\mysql-8.0.4\my.ini
Service successfully installed.

C:\mysql-8.0.4>net start wampmysqld64
The wampmysqld64 service is starting.
The wampmysqld64 service was started successfully.

C:\mysql-8.0.4>bin\mysql -uroot -p --port=4040
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)

C:\mysql-8.0.4>bin\mysql -uroot -p
Enter password:
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> show variables like "port";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port          | 3306  |
+---------------+-------+
1 row in set (0.01 sec)

mysql>

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C:\>cd mysql-5.7.21

C:\mysql-5.7.21>bin\mysqld.exe --initialize-insecure

C:\mysql-5.7.21>type my.ini
[wampmysqld64]
basedir=c:\mysql-5.7.21
datadir=c:\mysql-5.7.21\data
port=4040
C:\mysql-5.7.21>bin\mysqld --install-manual wampmysqld64 --defaults-file=c:\mysql-5.7.21\my.ini
Service successfully installed.

C:\mysql-5.7.21>net start wampmysqld64
The wampmysqld64 service is starting.
The wampmysqld64 service was started successfully.

C:\mysql-5.7.21>bin\mysql -uroot -p --port=4040
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.21 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> show variables like "port";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| port          | 4040  |
+---------------+-------+
1 row in set (0.00 sec)
[12 Apr 12:01] Miguel Solorzano
Please see https://bugs.mysql.com/bug.php?id=78959 regarding path \bin issue.
[19 Apr 14:28] Dominique Ottello
Bug still present in version 8.0.11 just officially released.
MySQL 8.0.11, under Windows, launched by a service, does not take into account the mysql options of the service name section, just like for this bug in version 8.0.4.
[19 Apr 16:16] Miguel Solorzano
https://bugs.mysql.com/bug.php?id=90512 marked as duplicate of this one.
[28 Jul 10:38] Dominique Ottello
Bug still present in version 8.0.12 just officially released.
MySQL 8.0.12, under Windows, launched as a service, does not take into account the mysql options of the service name section, just like for this bug in version 8.0.4 and 8.0.11
MySQL 8.0.x is unusable under Windows as a service.
I hope that this bug that dates back three versions will finally be fixed in the next version of MySQL.
I will no longer offer MySQL 8 with Wampserver that I replace with MariaDB.