2011-08-17 141 views
3

我想通过SSL连接到MySQL服务器。更具体地说,我想用DbExpress做到这一点。使用DBExpress通过SSL连接到MySQL

我以前通过ZeosLib使用过SSL。这很好,但Zeos不让我运行返回多个结果集的存储过程,这是该项目中的一个显示屏。

用的Zeos,我用来设置这样的SSL连接:

Connection := TZConnection.Create(nil); 
    Connection.Properties.Values['MYSQL_SSL']  := 'TRUE'; 
    Connection.Properties.Values['MYSQL_SSL_CA'] := 'c:/pathtocert/cert.pem'; 
    Connection.Properties.Values['MYSQL_SSL_CERT'] := 'c:/pathtocert/foo.pem'; 
    Connection.Properties.Values['MYSQL_SSL_KEY'] := 'c:/pathtocert/bar.pem'; 

我看到,你可以做同样的事情与DBX:

Connection.Params.Values['drivername'] := 'MySQL'; 
Connection.Params.Values['compressed'] := 'True'; 
Connection.Params.Values['HostName'] := 'host'; 
Connection.Params.Values['Database'] := 'dbname'; 
Connection.Params.Values['user_name'] := 'me'; 
Connection.Params.Values['Password'] := '...'; 
Connection.Params.Values['encrypted'] := 'True'; // looks promising! 

我看到,你可以设置一个名为'encrypted'的参数,但我看不到我可以如何配置证书的位置。 LibMySQL.dll需要这些才能设置其加密连接。

所以我的问题是:

  1. 不DBX让我建立加密引黄?
  2. 如果是这样,谁能告诉我该怎么做? :)

回答

1
  1. Embarcadero MySQL dbExpress驱动程序不支持SSL连接。虽然这实际上很简单。您可以将此请求记录到QC。
  2. 您可以考虑使用3D聚会产品,如AnyDAC。