OpenSource

mysql 5.7.17 tar.gz version 설치(centos)

아르비스 2017. 2. 10. 16:36
  1.  설치 준비
    1. download : https://dev.mysql.com/downloads/mysql/5.7.html#downloads
    2. Select Platform에서 Linux-Generic 선택
    3. 'Linux - Generic (glibc 2.5) (x86, 64-bit), TAR ' download
  2.  설치
    1. 계정생성
      • useradd -r mysql -U
    2.  설치파일
      • tar -xvf  mysql-5.7.17-linux-glibc2.5-x86_64.tar
      • tar -zxvf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
      • mv mysql-5.7.17-linux-glibc2.5-x86_64 mysql-5.7.17
      • cp mysql-5.7.17/mysql.server /etc/init.d/mysqld
      • chmod 755 /etc/init.d/mysqld
      • vi /etc/init.d/mysqld
      • basedir=

        # datadir=

        # mysqld_pid_file_path=

        ## 주석 처리

    3. Config File 생성
      • mkdir conf  
      • cp support-files/my-default.cnf /etc/my.cnf   
      • vi /etc/my.cnf
      •  [client]

        port = 3306  #mysql포트

        socket = ./mysql-5.7.17/conf/mysql.sock

        default-character-set = utf8

         


        [mysqld]

        basedir=/block3/mysql-5.7.17         #Mysql Engine Directory

        datadir=/block3/mysql-5.7.17/data/   #Data Directory

        init_connect = SET collation_connection = utf8_general_ci

        init_connect = SET NAMES utf8

        character-set-server = utf8

        collation-server = utf8_general_ci

        user=mysql #mysql계정

        port=3306  #mysql포트

        socket=/block3/mysql-5.7.17/conf/mysql.sock

        pid-file=/block3/mysql-5.7.17/conf/mysqld.pid


        [mysqldump]

        default-character-set = utf8


        [mysql]

        default-character-set = utf8


        # Disabling symbolic-links is recommended to prevent assorted security risks

        symbolic-links=0


        [mysqld_safe]

        log-error=/block3/mysql-5.7.17/log/mysqld.log

        #pid-file=/var/run/mysqld/mysqld.pid


        default-time-zone='UTC'


        [mysqld]

        log-error=/block3/mysql/log/error.log


  3.  Service 실행
    1. service mysqld start 
  4.