Open DigitalPlatform opened 2 years ago
1.8.24.0 通过上面配置修改后,可以通过命名管道连接 1.8.27.0 通过上面配置修改后,可以通过命名管道连接
当MySQL安装高于8.0.23 版本时,配置上面参数,观察是否可以通过命名管道方式连接MySQL
port=3306---------# port=3306、# skip-networking--------------skip-networking
named_pipe_full_access_group=everyone
20211122-wy:MySQL版本:8.0.27 dp2installer正式版:3.5.1.0 测试结果符合预期
20211122-wy:MySQL版本:1.8.24. dp2installer正式版:3.5.1.0 测试结果符合预期
dp2kernel 用 NamedPipe 方式连接 MySQL 8.0.24(注:有说 8.0.23) 以上版本时,会抛出 System.UnauthorizedException 异常。
这篇文字里面提供了线索信息: https://dev.mysql.com/doc/connectors/en/connector-j-named-pipe.html
named_pipe_full_access_group
(Windows only.) The access control granted to clients on the named pipe created by the MySQL server is set to the minimum necessary for successful communication when the
named_pipe
system variable is enabled to support named-pipe connections. Newer MySQL client software can open named pipe connections without any additional configuration; however, older client software may still require full access to open a named pipe connection.This variable sets the name of a Windows local group whose members are granted sufficient access by the MySQL server to use older named-pipe clients. As of MySQL 8.0.24, the default value is set to an empty string, which means that no Windows user is granted full access to the named pipe.
A new Windows local group name (for example,
mysql_old_client_users
) can be created in Windows and then used to replace the default value when access is absolutely necessary. In this case, limit the membership of the group to as few users as possible, removing users from the group when their client software is upgraded. A non-member of the group who attempts to open a connection to MySQL with the older named-pipe client is denied access until a Windows administrator adds the user to the group. Newly added users must log out and log in again to join the group (required by Windows).Setting the value to
'*everyone*'
provides a language-independent way of referring to the Everyone group on Windows. The Everyone group is not secure by default.解决办法
打开 MySQL 的 my.ini 文件,在
[mysqld]
小节内增加一行 named_pipe_full_access_group 变量定义,如下: