603
中电云集
测试使用PHP连接数据库的方法。
直接使用以下代码:
#Mysql 帐号用户名,请将xxxx改为您相应的用户名
$mysql_user = “xxxx”;
#Mysql 帐号密码,请将xxxx改为您相应的密码
$mysql_password = “xxxxxx”;
$link = mysql_connect(”localhost”,$mysql_user,$mysql_password) or die(”Could not connect”);
print (”Connected successfully”);
mysql_close($link);
?>
如果您可以在网页上看到“Connected successfully”的字样,就证明数据库可正常使用了。
最后更新:2017-01-04 22:34:51