想不出写啥2018-01-15 11:32:26
How to determine the mysql database connection address? -PHP Chinese website Q&A-How to determine the mysql database connection address? -PHP Chinese website Q&A
Let’s take a look and learn.
钟毅2017-10-04 17:32:23
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect : ' . mysql_error());
}
// some code
?>
This is the first type and is suitable for all versions. .
'jian', /* The user to connect as MySQL username*/
'123456', /* The password to use MySQL password*/
'jian'); / * The default database to query connection database name*/if (!$link) {
printf("Can't connect to MySQL Server. Errorcode: %s ", mysqli_connect_error());
exit;
}else
echo 'The database is connected! ';/* Close the connection Close the connection */mysqli_close($link);?>
数据分析师2017-09-30 23:15:53
How to determine the mysql database connection address? -PHP Chinese website Q&A-How to determine the mysql database connection address? -PHP Chinese website Q&A
Please watch and learn.
迷茫2016-12-20 16:32:04
jdbc:mysql://[数据库服务器IP地址]/[数据库名] 例如:局域网内一mysql服务器 IP地址为172.10.1.100,数据库名为test 链接地址为 jdbc:mysql://172.10.1.100/test 如果是本机,IP地址可以直接写为localhost