초보자입니다. 나는 서버 웹 http://www.barman-team.ir/tt.php 에 간단한 PHP 페이지를 복사하고 난 SQL 데이터베이스를 가져오고 사용자 &을 만들고 로컬 호스트 (xamp)에경고 : mysql_connect() : 사용자에 대한 액세스가 거부되었습니다.
이 페이지 작업 (의 cPanel에서) 데이터베이스를 전달하지만, 서버에서 실행 해달라고
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body dir="rtl">
<?php
$link=mysql_connect("localhost","uname","pass");
mysql_select_db("barmante_ebram",$link);
$q="SELECT * FROM site_sug";//
$r=mysql_query($q,$link);
$line= mysql_fetch_array($r);
//while($line== $result->fetch_assoc()){
echo $line['site_suggestion_id'].$line['site_suggestion']."<br>";
//echo $row["site_suggestion_id"].$row["site_suggestion_name"].$row["site_suggestion_date"].$row["site_suggestion"]."<br>";
//}
?>
</body>
</html>
오류 로그는 다음과 같습니다 첫 번째 오류는 사용자 이름 비밀번호 당신은 당신의 MySQL과 다른에 연결할 수 있다는 것을 의미 공급 된 것을 말하고
Warning: mysql_connect(): Access denied for user 'barmante_ebram_u'@'localhost' (using password: YES) in /home/barmante/public_html/tt.php on line 11
Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /home/barmante/public_html/tt.php on line 12
Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/barmante/public_html/tt.php on line 14
Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in /home/barmante/public_html/tt.php on line 15
오류 메시지에 대해 명확하지 않은 점은 무엇입니까? 실제 환경에는 테스트 환경과 다른 사용자 이름 및/또는 암호가 필요합니다. – Quentin
** 경고 ** : [오래된 ** 데이터베이스 API] (http://stackoverflow.com/q/12859942/19068)를 사용하고 있으며 [최신 대체] (http : // php. net/manual/ko/mysqlinfo.api.choosing.php). – Quentin