Using this code I'm able to connect to mysql using zend framework normally:
resources.db.adapter = "Pdo_Mysql"
resources.db.params.host = "xx.xx.xx.xx"
resources.db.params.username = "test_user"
resources.db.params.password = "test_pass"
resources.db.params.dbname = "test_database"
resources.db.params.port="xxxx"
;parameters here for ssl connection??
In my Controller
:
public function indexAction() {
$config = new Zend_Config_Ini('/path/to/application.ini', 'development');
$db = Zend_Db::factory($config->resources->db);
$sql = 'SELECT * FROM test_table';
$result = $db->fetchAll($sql);
echo '<pre>';
print_r($result);
}
Now the problem is that I want to connect to mysql using ssl, but I haven't found any documentation on how to do that.
I managed to make a connection using Navicat to the server with the help of the database admin by configuring the ssl connection as follows:
The problem now is how to connect using php?
You should be able to specify driver options like this:
;PDO::MYSQL_ATTR_SSL_KEY
resources.db.params.driver_options.1010 = "/path/to/client-key.pem"
;PDO::MYSQL_ATTR_SSL_CERT
resources.db.params.driver_options.1011 = "/path/to/client-cert.pem"
;PDO::MYSQL_ATTR_SSL_CA
resources.db.params.driver_options.1012 = "/path/to/ca-cert.pem"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With