I created a custom module and to try to override vendor/magento/framework/DB/Adapter/Pdo/Mysql.php and vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php


<preference for="Magento\Framework\DB\Adapter\Pdo\Mysql" type="Test\MySQLCluster\DB\Adapter\Pdo\Mysql" />

does not work for vendor/magento/framework/DB/Adapter/Pdo/Mysql.php

And for vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php I don`t know how to do it.

1 Answer 1


A normal preference won't work indeed, but you can copy it to the lib directory. It's not a very clean way of working but in this case required.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.