
SwooleCoroutineMySQL::__construct 메소드의 파라미터는 다음과 같습니다.
- string $host: MySQL 서버의 호스트 이름 또는 IP 주소
- int $port: MySQL 서버의 포트 번호
- string $username: MySQL 서버의 사용자 이름
- string $password: MySQL 서버의 비밀번호
- string $database: MySQL 서버의 데이터베이스 이름
- array $options: 옵션 배열 (선택 사항)
예를 들어, 다음과 같이 사용할 수 있습니다.
#hostingforum.kr
php
$mysql = new SwooleCoroutineMySQL('localhost', 3306, 'username', 'password', 'database');
또는 옵션 배열을 사용할 수 있습니다.
#hostingforum.kr
php
$options = [
'charset' => 'utf8mb4',
'timeout' => 5,
];
$mysql = new SwooleCoroutineMySQL('localhost', 3306, 'username', 'password', 'database', $options);
이러한 옵션 배열을 사용하여 MySQL 서버와의 연결을 조정할 수 있습니다.
2025-06-01 04:31