您好,我正在使用 xampp,我正在尝试使用 php 进行连接。
<?php $server = localhost; $username = root; $password = ******;?>
$sql_connections = mysql_connect("$server, $username, $password") or die(mysql_error());
Warning: mysql_connect() [function.mysql-connect]: php_network_getaddresses: getaddrinfo failed: Host desconocido. in C:\xampp\htdocs\Database Manager\admin\sql_functions.php on line 17
Warning: mysql_connect() [function.mysql-connect]: [2002] php_network_getaddresses: getaddrinfo failed: Host desconocido. (trying to connect via tcp://localhost, root, usd27498:3306) in C:\xampp\htdocs\Database Manager\admin\sql_functions.php on line 17
最佳答案
您使用了不正确的符号来设置服务器:
mysql_connect("$server, $username, $password")
需要
mysql_connect($server, $username, $password)
关于找不到 phpmyadmin 主机!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5209255/