MySQL와 MFC를 ODBC로 연동하기

기타/잡다한것

MySQL와 MFC를 ODBC로 연동하기

WillBe_ 2018. 3. 13. 16:45

 

솔직히 제목이 맞는지도 모르겠습니다.

MFC 왜 이렇게 어렵고 하기 싫은지..ㅜ,ㅠ

 

MySQL과 MFC를 ODBC를 연결하고자합니다.(맞는 표현인가..?)

-> 이건 텍스트 파일만 됩니다.

 

1. ODBC를 검색하여 프로그램을 열어줍니다.

 

 

 

2. 아래와 같은 화면에서 빨간색으로 표시됨 '추가(D)'버튼을 눌러준다.

 

 

 

 

3. 추가 버튼을 누루면 아래 화면이 보일 것 입니다. 화면이 보이면

MySQL ODBC ANSI Driver

MySQL ODBC Unicode Driver

   두개 중에서 원하는 텍스트 형식(?)을 선택하고 마침을 눌러줍니다.

 

 

 

4. 마침을 누루면 아래 그림과 같은 화면이 나옵니다.

 

 

https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration-dsn-windows-5-2.html의 설명을 보면

 

In the Data Source Name box, enter the name of the data source to access. It can be any valid name that you choose.

 

  1. In the Description box, enter some text to help identify the connection.
  2. In the Server field, enter the name of the MySQL server host to access. By default, it is localhost.
  3. In the User field, enter the user name to use for this connection.
  4. In the Password field, enter the corresponding password for this connection.
  5. The Database pop-up should be automatically populated with the list of databases that the user has permissions to access.
  6. To communicate over a different TCP/IP port than the default (3306), change the value of the Port.
  7. Click OK to save the DSN.

그림의 항목 설명이 위와 같습니다.

 

 

Data Source Name : 원하는 아무거나 적어주세요~

TCP/IP sever : 저는 제 컴퓨터에서만 사용할 것 이니 위와 같이 적어주었습니다.

User : 사용자 권한으로 root

Password : 사요하고자 하는 MySQL 비밀번호

Database : 사용하고자 하는 항목을 정해줍니다.

 

 

5. 마지막으로 Details>>를 눌러준 후, Curosors/Results 항목에서 Enable dynamic cursors를 체크해주면 끝입니다.