New versions of WAMP seems to install both MySQL and MariaDB. And when I logged in through the phpMyAdmin, I saw that the MySQL is using the port 3308.
So in my PHP code, instead of using just localhost
for my database hostname, I added the port to it like this: localhost:3308
and it worked.
$db = new mysqli('localhost:3308', 'root', 'password', 'db_name');
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…