티스토리 뷰

Developer

[mysql] 5.5 설치

rocksea 2012. 8. 7. 11:57

mysql 5.5 source 설치법에 대하여 알아보도록 하겠습니다.

설치환경

OS : ubuntu 12.04

Cmake : 2.8.8

MySQL : 5.5.27

 

Download URL : http://dev.mysql.com/downloads/mysql/

 

step 1. mysql 압축해제

$ tar xvfz mysql-5.5.27.tar.gz

 

step 2. mysql compile

$ cd mysql-5.5.27/

$ sudo cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DWITH_EXTRA_CHARSETS=all -DMYSQL_DATADIR=/usr/local/mysql/data -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR=/usr/local/mysql/sock/mysql.sock -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DWITH_EXTRA_CHARSETS=all -DMYSQL_TCP_PORT=3306

$ sudo make

$ sudo make install

missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH  라는 오류로 cmake 에 실패 할 경우 

$ sudo apt-get install libncurses5-dev

$ rm CMakeCache.txt

이후 step 2 의 작업을 반복합니다.

 

step 3. db 초기화

$ cd /usr/local/mysql/scripts/

$ mysql_install_db --user=mysql --basedir=/usr/local/mysql

[### 2014.01.27 추가 ###]

2014-01-27 21:19:16 4158 [ERROR] COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'utf8'

2014-01-27 21:19:16 4158 [ERROR] Aborting

2014-01-27 21:19:16 4158 [Note] Binlog end

2014-01-27 21:19:16 4158 [Note] /usr/local/mysql/bin/mysqld: Shutdown complete


 COLLATION 'latin1_swedish_ci' is not valid for CHARACTER SET 'utf8' 오류시 아래 참조

my.cnf

# The MySQL server

[mysqld]

# encoding

# 2014.01.27 by rocksea

character-set-server = utf8

collation-server    = utf8_general_ci

character-set-client-handshake = false


[### End of 2014.01.27 추가 ###]

step 4. mysqld 실행

$ cd /usr/local/mysql/bin

$ mysqld_safe --user=mysql &

 

step 5. mysql root password 설정 및 접속

$ mysqladmin -uroot password 1234

$ mysql -uroot -p1234

 

step 6. DB 생성 및 권한 설정

mysql> create database rocksea;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on rocksea.* to 'rocksea'@'localhost' identified by '1234' with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| rocksea            |
| test               |
+--------------------+
5 rows in set (0.00 sec)

 

이상으로 mysql 5.5 설치에 대해서 알아보았습니다.

by rocksea.

 

 

댓글