How to change database configuration in zend framework 2. Working on a old application when tried to edit database name in config/autoload/local.php it not given any error.I have change the
'db' => array(
'driver' => 'Pdo',
'dsn' => 'mysql:dbname=backend;host=localhost',
'driver_option' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
),
),
dsn but nothing happened.I am new on zend worked on codeigniter.I have change dsn dbname=new but still get connected with the old database.
More than likely, the configuration of your application is cached (which is a good thing in production environments, a bit less in development) and your changes doesn't affect anything because... cache!
If you need this in a development environment, I suggest you to disable the cache. Search into
/config/application.config.phpthe keysconfig_cache_enabledandmodule_map_cache_enabledand set them tofalse.If you just need a "one time cache refresh", then just clear the folder
/data/cache. If this folder is already empty (or does not exists), search the keycache_dirin the/config/application.config.php. This options defines the path of the cache folder.