所以,當(dāng)我嘗試在沒(méi)有標(biāo)志的情況下創(chuàng)建連接時(shí),它工作得很好。$db_init_conn = mysqli_init();$db_conn = mysqli_real_connect($db_init_conn, HOSTNAME, DBUSERNAME, DBPASSWORD,DATABASE);但是當(dāng)我這樣使用標(biāo)志時(shí)。$db_init_conn = mysqli_init();$db_conn = mysqli_real_connect($db_init_conn, HOSTNAME, DBUSERNAME, DBPASSWORD,DATABASE,$flags=MYSQLI_CLIENT_INTERACTIVE);我懂了警告:mysqli_real_connect():(HY000/2002):無(wú)法建立連接,因?yàn)槟繕?biāo)機(jī)器主動(dòng)拒絕。我做錯(cuò)了什么?更新當(dāng)我使用其他標(biāo)志時(shí)也會(huì)發(fā)生$mysqli = mysqli_init();DBPASSWORD,DATABASE); $db_conn = mysqli_real_connect($mysqli, HOSTNAME, DBUSERNAME, DBPASSWORD,DATABASE, $flags=MYSQLI_CLIENT_COMPRESS);
使用標(biāo)志時(shí) MySQL 連接被拒絕
桃花長(zhǎng)相依
2023-05-26 16:22:02