How to configure Mysql in the BaePHP Environment

Source: Internet
Author: User
* 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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.