Andre_C10002 has asked for the wisdom of the Perl Monks concerning the following question:
Hello guys,
Long time reader but this is my first question.
I have a MySQL server in a data center and processing servers in another place, therefore I need to encrypt connections from my Perl scripts to the database. All the necessary settings were made on MySQL (creation of a new user, creation of ca, server and client keys) and MySQL connections over SSL work fine.
root@server:# mysql -h _HOST_ --port 3306 -u _SSL_USER_ --ssl-cert=/et +c/mysql/certs/client-cert.pem --ssl-key=/etc/mysql/certs/client-key.p +em -p _DATABASE_ Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 49694205 Server version: 5.0.96 Source distribution ...
So, I believe set up is good. The problem is that I can't make my Perl script to connect to the database. The returned error is simply:
Access denied for user '_SSL_USER_'@'_HOST_' (using password: YES) at temp.pl line 7.To simplify, I've put only the following code in my script:
#!/usr/bin/perl use strict; use DBI; #DBI->trace(5); my $dbh = DBI->connect( "DBI:mysql:database=_DATABASE_;host=_HOST_; mysql_ssl=1; mysql_ssl_client_key=/etc/mysql/certs/client-k +ey.pem; mysql_ssl_client_cert=/etc/mysql/certs/client- +cert.pem; mysql_ssl_ca_file=/etc/mysql/certs/ca-cert.pem +", '_SSL_USER_', '_SSL_USER_PWD_' ) || die DBI->errstr; exit(0);
The DBD::mysql module was compiled with the '-ssl' option.
I can't figure it out or find ways to further debug. Any help would be much appreciated.
Thank you!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: DBI:mysql connection over SSL fails
by kcott (Archbishop) on May 09, 2014 at 04:50 UTC | |
by Andre_C10002 (Initiate) on May 09, 2014 at 13:57 UTC | |
by kcott (Archbishop) on May 10, 2014 at 00:26 UTC | |
by Andre_C10002 (Initiate) on May 13, 2014 at 18:46 UTC | |
by Anonymous Monk on Oct 02, 2014 at 21:02 UTC | |
by Anonymous Monk on Jan 15, 2016 at 20:27 UTC | |
Re: DBI:mysql connection over SSL fails
by Andre_C10002 (Initiate) on May 09, 2014 at 02:42 UTC |