I'm running custom script on my Linux Server.
I don't want that script to affect my current database. Username/Password/Host will be same.
Only DB name is changed. How can I do that without changing in env.php
?
// MAGENTO START
include(dirname(__DIR__) . '/app/bootstrap.php');
use Magento\Framework\App\Bootstrap;
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();
$state = $objectManager->get('Magento\Framework\App\State');
$state->setAreaCode('frontend');
$deploymentConfig = $objectManager->create('Magento\Framework\App\DeploymentConfig');
$dbName = $deploymentConfig->get('db/connection/default/dbname'); // Get Current DB Name
On server my website is already running. Don't want to affect that. So need to run script for new DB only.