Ⅲ. 정보보안
[프로젝트] 홈페이지 구축 (mysql 연동) v0.5
agencies
2024. 2. 29. 08:34
https://dev.mysql.com/downloads/installer/
MySQL :: Download MySQL Installer
Note: MySQL 8.0 is the final series with MySQL Installer. As of MySQL 8.1, use a MySQL product's MSI or Zip archive for installation. MySQL Server 8.1 and higher also bundle MySQL Configurator, a tool that helps configure MySQL Server.
dev.mysql.com
위 사이트에서 다운로드를 합니다.
Execute 버튼을 클릭합니다.
Next 버튼을 쭉 누릅니다.
비밀번호를 설정합니다. 저는 apmsetup으로 입력했습니다.
php.ini 파일에서 mysqli 부분을 찾아 주석해제합니다.
아래의 한 줄을 추가합니다.
※ mysql 실행이 되지 않아(mysql 위치 변경 c->d)
관리도구에서 mysql 관련 서비스를 시작했습니다.
하지만 서비스가 동작하지 않아 레지스트리에서 직접 경로를 수정했습니다.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
위의 경로로 이동하여 mysql부분을 찾아 ImagePath 부분을 수정합니다.
성공적으로 mysql가 실행되었습니다.
httpd.conf 파일에서
servername 부분을 localhost로 수정했습니다.
php 접속 확인 index.php
<?php
$connect = mysqli_connect("localhost", "root", "apmsetup");
if (!$connect) {
echo '연결실패: ' . mysqli_connect_error();
} else {
echo '연결성공!';
}
?>