* Replace it with your own database name (which can be viewed from the Management Center) * $ dbnameMCpLBnaTwQudcCVdIeCa; * retrieve the database connection parameter from the BAE environment variable * $ hostgetenv (HTTP_BAE_ENV_ADDR_ SQL _IP ); $ portgetenv (HTTP_BAE_ENV_ADDR_ SQL _PORT); $ usergetenv (HTTP_BAE_EN
/* Replace it with your own database name (which can be viewed from the Management Center) */$ dbname = 'mcplbnatwqudccvdieca '; /* obtain the database connection parameters from the BAE environment variable */$ host = getenv (HTTP_BAE_ENV_ADDR_ SQL _IP); $ port = getenv (HTTP_BAE_ENV_ADDR_ SQL _PORT); $ user = getenv (HTTP_BAE_EN
/* Replace it with your own database name (which can be viewed from the Management Center )*/
$ Dbname = 'mcplbnatwqudccvdieca ';
/* Retrieve the database connection parameters from the BAE environment variables */
$ Host = getenv ('HTTP _ BAE_ENV_ADDR_ SQL _IP ');
$ Port = getenv ('HTTP _ BAE_ENV_ADDR_ SQL _PORT ');
$ User = getenv ('HTTP _ BAE_ENV_AK ');
$ Pwd = getenv ('HTTP _ BAE_ENV_SK ');
$ Dbconfig = array (
// Database configuration information
'Db _ type' => 'mysql', // Database TYPE
'Db _ host' => $ HOST, // server address
'Db _ name' => $ dbname, // Database NAME
'Db _ user' => $ USER, // user Name
'Db _ pwd' => $ PWD, // Password
'Db _ port' => $ PORT, // port
'Db _ prefix' => 'tenking _ ', // database table PREFIX
);
The key is to obtain mysql configuration information through environment variables.
Original article address: how to configure Mysql in the Bae PHP environment? Thanks to the original author for sharing.