Mysql_skip_secure_auth does not skip protected auth

Change . From what I can tell, the main reason for this problem is that the correct Perl modules are installed, but the wrong file is loading mysql.so.

my $dsn = "DBI:mysql:"
    . "database=$db;"
    . "host=$dbhost;"
    . "mysql_ssl=$dbssl;"
    . "mysql_skip_secure_auth=1;";

I recently tried updating our version of DBD :: mysql, but continued to encounter an error DBI connect('database=mydb;host=myhost','myuser',...) failed: Connection using old (pre-4.1.1).

After many hours of debugging and determining that the correct option not to update the password hashing methods of our mysql tables was not possible with our common system, I found that with DBD :: Mysql 4.027 you can declare "mysql_skip_secure_auth" as part of your dsn.

However, this does not work.

If I run mysql -h $myhost -u $myuser -p --skip-secure-auth, I can connect without incident, but trying to do this with DBI / DBD :: mysql, I always encountered the error above, as if the directive was ignored.

I also tried using mysql_read_default_filewith the same set of parameters, and also just mysql_skip_secure_authin DSN. None of these things worked.

Did I miss something?

EDIT:

Trace output (edited to delete confidential information):

imp_dbh->mysql_dr_connect: host = |{host}|, port = 0, uid = {user}, pwd = {pwd}
imp_dbh->mysql_dr_connect: Skipping secure auth
imp_dbh->bind_type_guessing: 0
imp_dbh->use_server_side_prepare: 0
imp_dbh->mysql_dr_connect: client_flags = 2
imp_dbh->mysql_dr_connect: <-           --> do_error
Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled) error 2049 recorded: Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)




my $versions = DBI->installed_versions;
foreach (keys %$versions) {
    print "\n$_: " . %$versions->{$_};
}

DBD::SQLite: 1.26                                                               
DBD::ExampleP: 12.014310                                                          
DBD::Sponge: 12.010002                                                             
DBD::Gofer: 0.015057                                                             
DBD::DBM: 0.06                                                                    
DBD::mysql: 4.027                                                                  
DBI: 1.618
+4
source share
2 answers

You are right that this area is a bit more complicated, but the problems seem to be related to C mysql lib, not DBD :: mysql.

First pass the parameter as a driver option, and not as part of the DSN main line: my @dsn = ("DBI:mysql:database=$db;host=$dbhost;mysql_ssl=$dbssl", $user, $pissword, { mysql_skip_secure_auth => 1 });

, .cnf .

. my @dsn = ("DBI:mysql:"database=$db;host=$dbhost;mysql_ssl=$dbssl;" . "mysql_read_default_file=$absolute_path.cnf", undef, undef, { mysql_skip_secure_auth => 1 });

, secure_auth, C lib , .

, , () secure_auth = FALSE skip_secure_auth ( , , mysql mysqldump, -).

C lib , secure_auth = FALSE secure_auth = TRUE, , , , skip_secure_auth , .

http://dev.mysql.com/doc/refman/5.6/en/mysql-options.html secure_auth , , () .

"", , v4.0, . , C, .cnf , .

, , skip_secure_auth, secure_auth [client] secure_auth = FALSE , , [mysql], [mysqldump] .., .

+3

Mysql 5.0 old_passwords. secure_auth = ON Troublshoot :

: --secure-auth, 'user' @'hostname' ; ,

mysql 16 . 41 . mysql_skip_secure_auth . secure_auth = OFF

old_passwords = 1

http://code.openark.org/blog/mysql/upgrading-passwords-from-old_passwords-to-new-passwords

0

Source: https://habr.com/ru/post/1533833/


All Articles