변군이글루

[MySQL] 5.6.x MySQL 설치 본문

및___APM

[MySQL] 5.6.x MySQL 설치

변군 변군이글루 2013.08.17 21:32

MySQL 설치(5.6.x)

 

다운로드

http://mirror.cogentco.com/pub/mysql/MySQL-5.6/

 

1. 라이브러리 설치

[root@lamp src]# yum install cmake ncurses-devel

 

2. MySQL 설치

[root@lamp src]# tar xvfz mysql-5.6.13.tar.gz

 

[root@lamp mysql-5.6.13]# useradd -m -c "MySQL Server" -d /usr/local/mysql -s /bin/false -u 27 mysql

 

[root@lamp mysql-5.6.13]# cmake \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \

-DMYSQL_DATADIR=/usr/local/mysql/data \

-DDEFAULT_CHARSET=utf8 \

-DDEFAULT_COLLATION=utf8_general_ci \

-DWITH_EXTRA_CHARSETS=all \

-DMYSQL_UNIX_ADDR=/tmp/mysql.socket

 

-------------------------------------------------------------------------------------------

[root@lamp mysql-5.6.13]# cmake \

-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \        //MySQL 디렉토리 지정

-DMYSQL_DATADIR=/usr/local/mysql/data \          //DB(data) 디렉토리 지정

-DDEFAULT_CHARSET=utf8 \                             //문서의 기본 언어셋

-DDEFAULT_COLLATION=utf8_general_ci \             //DB의 언어셋

-DWITH_EXTRA_CHARSETS=all \                         //name 추가로 지정할 언어로 기본값은 all

-DMYSQL_UNIX_ADDR=/tmp/mysql.socket             //소켓 디렉토리 지정

-------------------------------------------------------------------------------------------

 

[root@lamp mysql-5.6.13]# make && make install

 

[root@lamp mysql]# cp /usr/local/mysql/my.cnf /etc/my.cnf

 

[root@lamp mysql]# chown -R mysql.mysql /usr/local/mysql/data

 

[root@lamp mysql]# ls -al | grep data

drwxr-xr-x   3 mysql mysql  4096 2013-08-17 20:54 data

 

[root@lamp mysql]# /usr/local/mysql/bin/mysql --verbose --help | grep -A 1 'Default options'

Default options are read from the following files in the given order:

/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf

 

[root@lamp mysql]# /usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data

 

[root@lamp mysql]# /usr/local/mysql/bin/mysqld_safe &

[1] 329

[root@lamp mysql]# 130817 21:23:58 mysqld_safe Logging to '/usr/local/mysql/data/lamp.sangchul.kr.err'.

130817 21:23:58 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data

 

[root@lamp mysql]# ps -ef | grep mysql | grep -v grep

root       329 14016  0 21:23 pts/0    00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe

mysql      424   329  2 21:23 pts/0    00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/data/lamp.sangchul.kr.err --pid-file=/usr/local/mysql/data/lamp.sangchul.kr.pid

 

[root@lamp mysql]# ln -s /usr/local/mysql/bin/mysql /usr/bin/

 

[root@lamp mysql]# /usr/local/mysql/bin/mysqladmin -u root password "비밀번호"

 

[root@lamp mysql]# mysql -u root -p mysql

Enter password:

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.6.13 Source distribution

 

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

 

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

 

mysql>

 

 

 

 

0 Comments
댓글쓰기 폼