본문 바로가기

옛날

MySQL Community Server ZIP Archive 설치방법

본 게시글은 윈도우10 Home버전으로 작성함.

윈도우 7 운영체제 이용 시 환경변수작업에서 인터페이스상의 차이가 있을 수 있음.



2017년 1월 3일기준으로 현재까지 MySQL 5.7버전부터는 64비트 운영체제에 대한 msi 인스톨러가 제공되지않음.

그러므로 ZIP Archive방식으로 설치를 해야하는데 설치 방법이 까다로움. (가급적 사진없이 포스팅 진행)


1. MySQL ZIP Archive 설치파일 다운로드


http://dev.mysql.com/downloads/mysql/ // Windows (x86, 64-bit), ZIP Archive 항목을 다운로드


(필자의 경우 ZIP 파일의 이름은 mysql-5.7.17-winx64)



2. 압축 해제 후 나온 폴더를 임의의 공간에 배치 (가급적 빨리 접근할 수 있는 곳)


Ex) C:\mysql-5.7.17-winx64 //폴더 이름을 mysql 등으로 간략화 하여 변경하여도 무관함. → C:\mysql


(필자는 E드라이브에 mysql폴더를 배치했다.)


3. mysql 폴더 내의 my-default.ini 파일 수정 후 다른이름으로 저장을 이용하여 my.ini로 저장




# For advice on how to change settings please see

# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html

# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the

# *** default location during install, and will be replaced if you

# *** upgrade to a newer version of MySQL.


[mysqld]


# Remove leading # and set to the amount of RAM for the most important data

# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

# innodb_buffer_pool_size = 128M


# Remove leading # to turn on a very important data integrity option: logging

# changes to the binary log between backups.

# log_bin


# These are commonly set, remove the # and set as required.

# basedir = .....

# datadir = .....

# port = .....

# server_id = .....



# Remove leading # to set options mainly useful for reporting servers.

# The server defaults are faster for transactions and fast SELECTs.

# Adjust sizes as needed, experiment to find the optimal values.

# join_buffer_size = 128M

# sort_buffer_size = 2M

# read_rnd_buffer_size = 2M 


sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 




# basedir = [현재 mysql폴더의 위치]

# datadir = [현재 mysql폴더의 위치\data]

# port = 3306 


Ex) 필자의 경우 아래와 같이 설정함.

# basedir = E:\mysql

# datadir = E:\mysql\data

# port = 3306



4. 환경변수 설정


제어판 - 시스템 및 보안 - 시스템 - 고급 시스템 설정 - 고급 - 환경 변수(N) - 시스템 변수(S) - Path


[윈도우 7]

1. Path를 더블 클릭 한다.

2. 변수 값(V): 의 내용 끝에 ;[현재 mysql폴더의 위치\bin] 을 입력 후 확인\

Ex) ...blahblah\blah;E:\mysql\bin


[윈도우 10]

1. Path를 더블 클릭 한다.

2. 새로 만들기(N) 을 클릭한다.

3. 선택된 텍스트 상자에 [현재 mysql폴더의 위치\bin] 를 입력 후 엔터 확인

Ex) E:\mysql\bin


5. cmd(명령 프롬프트)를 관리자 권한으로 실행 후 명령어 입력


1) mysqld.exe --initialize

2) mysqld.exe --install

3) mysqld --console --explicit_defaults_for_timestamp --skip-grant-tables

4) 3)의 명령어 입력 시 엑세스를 승인하겟냐고 묻는데, 허용해주자. 이 때 cmd창을 끄지말고 가만히 냅두자.


여기까지가 ZIP Archive 설치방법의 끝이다. 추가로 mysql 접속 및 root계정의 비밀번호 설정하겠음.


6. 새로운 cmd(명령 프롬프트)창을 열어서 명령어 입력


1) mysql -u root mysql 를 입력한다. 끝에 mysql> 하는 녀석이 보인다면 mysql 접속 성공

2) update user set authentication_string = password('새 비밀번호') where user = 'root';


ex) update user set authentication_string = password('1234') where user = 'root';


3) flush privileges; // 변경사항 적용의 역할을 하는 명령어

4) alter user 'root'@'localhost' identified by '설정햇던 비밀번호';


5) \q 입력 후 (로그아웃임) 다시 mysql -uroot -p비밀번호 로 접속해보면 잘 접속되는 것을 알 수 있음


하나하나가 절대 실수해선안되는 과정이다. 자칫하면 괴상한 오류로 이어지는데 빨리 msi설치파일을 배포했으면한다.

너무 설치과정이 까다롭다..