我連接亞馬遜RDS使用PHP使Web服務亞馬遜我的SQL RDS,但它不連接到這裏的服務器是我的代碼無法連接使用PHP
<?php
try{
$dbhost = 'myrds.cjahuqpumuov.us-east-1.rds.amazonaws.com:3306';
$username = 'myname';
$password = 'mypassword';
$dbname = 'mydb';
$link = mysql_connect($dbhost, $username, $password, $dbname);
mysql_select_db($dbname);
}
catch(Exception e){
echo e
}
?>
解析錯誤:語法錯誤,意外T_STRING,預計在T_VARIABLE上/home/content/i/h/u/ihus235/html/cs/pah_brd_v1/productivo/selectTest.php線路17
錯誤跟蹤
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 110 in /home/content/i/h/u/ihus235/html/cs/pah_brd_v1/productivo/selectTest.php on line 12
Warning: mysql_select_db() [function.mysql-select-db]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/i/h/u/ihus235/html/cs/pah_brd_v1/productivo/selectTest.php on line 13
Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/content/i/h/u/ihus235/html/cs/pah_brd_v1/productivo/selectTest.php on line 13
顯示同樣的問題解析錯誤有用解決/i/h/u/ihus235/html/cs/pah_brd_v1/productivo/selectTest.php第17行 – user3278422
你以前用'http://'試過了。 'http:// myrds.cjahuqpumuov.us-east-1.rds.amazonaws.com' –
並且我可能知道主機名是正確的嗎? –