百度开发这云开发 的mysql数据库密码

<?php
/*替换为你自己的数据库名(可从管理中心查看到)*/ 
$dbname = 'IchawLxUiMsfHlhtQHTm'; 
/*从环境变量里取出数据库连接需要的参数*/
$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'); 
//echo 'host:'.$host.'</br>'; echo 'port:'.$port.'</br>';
//echo 'user:'.$user.'</br>'; echo 'pwd:'.$pwd.'</br>';  
/*接着调用mysql_connect()连接服务器*/ 
$link = @mysql_connect("{$host}:{$port}",$user,$pwd,true); 
if(!$link) {    die("Connect Server Failed: " . mysql_error()); } 




你可能感兴趣的:(百度开发这云开发 的mysql数据库密码)