I have to connect to mysql database specifing the protocol as in this command line:
mysql -P port_number -u user -ppassword --protocl=tcp -D database -h hostname
Well, port number I think is possible to pass adding ":port_number" to the "hostname" in tag. User name, database and password have their own tag as in the next example:
<connection>
<host><![CDATA[hostname:port_number]]></host>
<username><![CDATA[user]]></username>
<password><![CDATA[password]]></password>
<dbname><![CDATA[pierpape_reciele]]></dbname>
<initStatements><![CDATA[SET NAMES utf8]]></initStatements>
<model><![CDATA[mysql4]]></model>
<type><![CDATA[pdo_mysql]]></type>
<pdoType><![CDATA[]]></pdoType>
<active>1</active>
</connection>
What about some other parameter like "protocol"?
Best Answer
Adding
to the
<connection>
element should work, because in the end, any additional elements gets added to the PDO dsn string, as you can see inZend_Db_Adapter_Pdo_Abstract::_dsn()
:It's using a blacklist, to not add configurations that are passed differently but it doesn't restrict any other parameters. So the configuration will result in this dsn, which should work for you: