500 Internal Server Error错误的一种可能原因
1、原因
由于修改了MySQL数据库的端口,所以造成数据库访问被拒绝。
$database = new MySQLi("127.0.0.1","root","root","TestDatabase");
解决方法为在IP处增加端口号:
$database = new MySQLi("127.0.0.1:8889","root","root","TestDatabase");
2、默认情况
当端口为默认时,
$database = new MySQLi("127.0.0.1","root","root","TestDatabase");
相当于
$database = new MySQLi("127.0.0.1:3306","root","root","TestDatabase");,
并且如果用户此时写其他端口,如
$database = new MySQLi("127.0.0.1:1234","root","root","TestDatabase");
那么页面吧报错,检查后发现会变成
$database = new MySQLi("127.0.0.1:1234:3306","root","root","TestDatabase");
浙公网安备 33010602011771号