MAC 下PHP連接不上MySQL
header("Content-Type:text/html;charset=utf-8"); $host?=?"127.0.0.1"; $user?=?"root"; $pass?=?"1223"; $link=mysqli_connect($host,$user,$pass)?or?die(mysql_error()); if?(!$link)?{????? ???printf("Can't?connect?to?MySQL?Server.?Errorcode:?%s?",?mysqli_connect_error());????? }?else{ ???echo?"sucess"; }
MAC10.12 下 用sublime2寫的代碼,隨便輸入密碼 都輸出“sucess”,用phpAdmin連接數(shù)據(jù)庫正常的。
2017-03-03
我試了一下,改了密碼就登不上??!注:我用的也是mac
2017-03-02
你的數(shù)據(jù)庫是沒有密碼的,wamp好像默認(rèn)phpmyadmin密碼是空的
2017-02-23
mysql 不需要密碼吧