I get this error when I try to connect to the mysql database using php mysqli class.

I am using OS :- windows 10 webserver :- xampp php :- 7.3.3

it got a warning error and error message is junk.

mysqli::__construct(): (HY000/2002): �ڑ��ς݂̌Ăяo���悪���̎��Ԃ�߂��Ă������������Ȃ��������߁A�ڑ��ł��܂���ł����B�܂��͐ڑ��ς݂̃z�X�g���������Ȃ��������߁A�m�����ꂽ�ڑ��͎��s���܂����

Using following code:

$dbServerName= "*******ap-northeast-1.rds.amazonaws.com";
$dbUsername= "example";
$dbPassword= "*******";
$dbName= "example";



// Create connection
$conn = new mysqli($dbServerName, $dbUsername, $dbPassword, $dbName);

// Check connection
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
} 
echo "Connected successfully";

dbServerName is amazon.com for example, password is * for security.

0 Answers