開始使用的是本地數據庫本地服務器沒有問題,當我上傳到雲服務器時提示鏈接失敗,查看輸出內容以下php
<b>Warning</b>: mysqli_connect() [<a href='function.mysqli-connect'>function.mysqli-connect</a>]: (HY000/2005): Unknown MySQL server host 'qdm174930306.my3w.com:3306' (1) in <b>/data/home/qxu1590160068/htdocs/tphp/getlist.php</b> on line <b>5</b><br /> 鏈接 MySQL 失敗: Unknown MySQL server host 'qdm174930306.my3w.com:3306' (1)<br /> <b>Warning</b>: mysqli_set_charset() expects parameter 1 to be mysqli, boolean given in <b>/data/home/qxu1590160068/htdocs/tphp/getlist.php</b> on line <b>11</b><br /> <br /> <b>Warning</b>: mysqli_query() expects parameter 1 to be mysqli, boolean given in <b>/data/home/qxu1590160068/htdocs/tphp/getlist.php</b> on line <b>16</b><br /> <br /> <b>Warning</b>: mysqli_close() expects parameter 1 to be mysqli, boolean given in <b>/data/home/qxu1590160068/htdocs/tphp/getlist.php</b> on line <b>27</b><br />
後來查了一下,發現把端口號寫到後面就能夠解決問題mysql
要把端口地址寫在最後面
"qdxxxxxxxxxxxxx3w.com","qdm17493045446","miama","qdasdas0306_db","3306"sql