APM설치(6) - 우분투 서버에 웹에서 DB연결 확인하기
[DB연결 애러 화면] 위 화면이 지난번 한글 설정에서 애러가 난 화면입니다. 여기서는 DB연결을 마쳐 홈페이지가 나오는 화면까지 확인해 보기로 합니다
[애러메시지] Warning: mysqli::__construct(): (HY000/1698): Access denied for user root@localhost in /var/www/html/moadb_test.php on line 16
root@test-host:~# mysql -u root -p Enter password:
MariaDB [(none)]> use mysql; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A
Database changed MariaDB [mysql]> update user set plugin= where User=root; Query OK, 1 row affected (0.02 sec) Rows matched: 4 Changed: 1 Warnings: 0
MariaDB [mysql]> flush privileges; Query OK, 0 rows affected (0.00 sec)
[최종적 웹페이지 확인]
위 화면에서 마지막 2개의 자료가 테스트용으로 입력한 자료입니다. 1 subject1content testid myname 0 2 subject2conten2t testid myname 0
이자료 대신에 게시판 내용 등을 붙이시변 바로 완성된 홈페이지가 됩니다.
이로써 apache와 php, 그리고 mysql 까지 연결이 끝났습니다. 지금 테스트한 moadb_test.php 를 바탕으로 게시판 자료를 올리시면 바로 홈페이지가 완료됩니다. 다음 포스팅에서는 가상 호스트를 설정해 보기로 합니다.
|