DBD-mysql icon indicating copy to clipboard operation
DBD-mysql copied to clipboard

add DBD::mysql::client_version() to have the client version without DB connections

Open gfx opened this issue 3 years ago • 0 comments
trafficstars

The value of mysql_get_client_version() is available via $dbh->{clientversion}, but it would be nicer if we can get the client library version without DB connections; For example, one would like to add or remove mysql_skip_secure_auth=1 to the dsn according to the client library version.


(edited)

As @miyagawa said, the following trick works as well:

$ perl -E 'use DBI; say(DBI::_new_dbh(DBI->driver("dbi:mysql:"))->{mysql_clientversion});'
80028

gfx avatar Apr 28 '22 06:04 gfx