I am trying to create a script that imports elements from a production database into a local one, but I am having problems switching production of the connection form to local.
Doctrine_Manager::getInstance()->setCurrentConnection('prod-slave');
Doctrine_Manager::getInstance()->setCurrentConnection('local');
When I run this, I get this error:
PHP Fatal error: throw a "Doctrine_Connection_Mysql_Exception" exception with the message "SQLSTATE [HY000]: General error: 1290 MySQL server is running with -read-only, so it cannot execute this statement in ...
If I close the connection with prod-slave before setting it to local, I get:
PHP Fatal error: throw a "Doctrine_Manager_Exception" exception with the message "Unknown connection: prod-slave" in ...
, , ( , ).
:
Doctrine_Manager::connection('mysql://path');
: 1.2.3
Symfony: 1.3.9
.