DB 를 설치해 보자.
먼저 설치를 하기 전에 현재 개발 서버에는 Mysql 3.2X 가 무수히 멀티로 운영중이며, 또한 MySQL 5.0x 버전 또한 설치가 되어 있다.
그렇기에 나는 기존 설치 방식이 아닌 다른 방식으로 설치를 진행할 수 밖에 없었다.
1. my.cnf 생성
이 부분은 앞으로 수정되어야 할 듯싶다.
#my.cnf 를 읽는 순서
#1. /etc/my.cnf파일
#2. /etc/mysql/my.cnf
#3. /usr/local/mysql/etc/my.cnf
#4. ~/.my.cnf
[client]
default-character-set = euckr
#default-collaction-set = euckr_korean_ci #euckr_bin
[mysqld]
user = mysql
port = 4958
basedir = /usr/local/rmysql
datadir = /usr/local/rmysql/data
tmpdir = /usr/local/rmysql/tmp
socket = /tmp/rmysql.sock
default-storage-engine = MyIsam
event-scheduler = ON
sysdate-is-now
#######
back_log = 100
max_connections = 300
max_connect_errors = 999999
thread_cache_size = 50
table_open_cache = 400
wait_timeout = 28800
max_allowed_packet = 32M
max_help_table_size = 32M
tmp_table_size = 512K
sort_buffer_size = 128K
join_buffer_size = 128K
read_buffer_size = 128K
read_rnd_buffer_size = 128K
query_cache_size = 32M
query_cache_limit = 2M
group_concat_max_len = 1024
########
######### MyISAM Option
## InnoDB를 사용하지 않고 MyISAM만 사용한다면 key_buffer_size 를 4GB까지 설정
key_buffer_size = 32M
bulk_insert_buffer_size = 32M
myisam_sort_buffer_size = 1M
myisam_max_sort_file_size = 2G
myisam_repair_threads = 1
myisam_recover
ft_min_word_len = 3
##로깅 옵션
pid-file = /usr/local/rmysql/logs/mysqld.pid
log-warnings = 1
log-error = /usr/local/rmysql/logs/mysqld
##General log 사용
general_log = 0
general_log_file = /usr/local/rmysql/logs/general_query.log
log_slow_admin_statements
slow-query-log = 1
long_query_time = 1
slow_query_log_file = /usr/local/rmysql/logs/slow_query.log
##replication option
##if this DB is Master DB then you need to remove #
log-bin = /usr/local/mysql/logs/binary_log
binlog_cache_size = 128K
max_binlog_size = 512M
expire_logs_days = 14
log-bin-trust-function-creators = 1
sync_binlog = 1
##if this DB is Slave DB then you need to remove #
#relay-log = /usr/local/rmysql/logs/relay_log
#relay_log_purge = TRUE
#read_only
##현재 서버가 슬레이브이면서 마스터 MySQL인 경우
##현재 MySQL 서버로 복제되는 쿼리를 바이너리 로그에 저장하려면 아래 주석을 해제
#log-slave-updates
위와 같이 작성 하였지만, 설치가 되지 않았다.
- ...../rmysql/scripts 에서 처음 DB생성을 시도하였지만 아래와 같은 에러가 발생하였다.
FATAL ERROR: Could not find .//usr/local/rmysql/bin/my_print_defaults
If you compiled from source, you need to run 'make install' to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.
검색하였더니 scripts 폴더가 아닌 mysql base 위치에서 진행하라고 나와 있었다.(외국 블로그)
그래서 다시 base위치에서 진행을 시도 하였지만...아래와 같이 진행되고 stop 되었다.
Installing MySQL system tables...2016-06-14 15:11:49 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --ex plicit_defaults_for_timestamp server option (see documentation for more details).
2016-06-14 15:11:49 0 [Note] ./bin/mysqld (mysqld 5.6.31-log) starting as process 13591 ...
결국 찾지 못하고 base에 my.cnf 를 설정하기로 했다.(최대한 my.cnf 내용은 간소하게..설치가 목적이라..)
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[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 = .....
# socket = .....
# 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
#default-character-set = euckr 이게 문제였다...
character-set-server = euckr 이렇게 작성해 주었다.
user = mysql
port = 4958
socket = /tmp/rmysql.sock
default-storage-engine = myisam
event-scheduler = ON
sysdate-is-now
key_buffer_size = 32M
bulk_insert_buffer_size = 32M
myisam_sort_buffer_size = 1M
myisam_max_sort_file_size = 2G
myisam_repair_threads = 1
myisam_recover
ft_min_word_len = 3
[root@devDB:/usr/local/rmysql]# ./scripts/mysql_install_db --defaults-file=/usr/local/rmysql/my.cnf --basedir=/usr/local/rmysql --datadir=/usr/local/rmysql/data --explicit_defaults_for_timestamp=on
또 에러 발생...
...
2016-06-14 15:40:33 13684 [Note] InnoDB: 5.6.31 started; log sequence number 0
2016-06-14 15:40:33 13684 [ERROR] /usr/local/rmysql/bin/mysqld: unknown variable 'default-character-set=euckr'
2016-06-14 15:40:33 13684 [ERROR] Aborting
2016-06-14 15:40:33 13684 [Note] Binlog end
2016-06-14 15:40:33 13684 [Note] InnoDB: FTS optimize thread exiting.
2016-06-14 15:40:33 13684 [Note] InnoDB: Starting shutdown...
2016-06-14 15:40:34 13684 [Note] InnoDB: Shutdown completed; log sequence number 1600607
2016-06-14 15:40:34 13684 [Note] /usr/local/rmysql/bin/mysqld: Shutdown complete
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/local/rmysql/bin/mysqladmin -u root password 'new-password'
/usr/local/rmysql/bin/mysqladmin -u root -h devDB password 'new-password'
Alternatively you can run:
/usr/local/rmysql/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd . ; /usr/local/rmysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd mysql-test ; perl mysql-test-run.pl
Please report any problems at http://bugs.mysql.com/
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
WARNING: Found existing config file /usr/local/rmysql/my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as /usr/local/rmysql/my-new.cnf,
please compare it with your file and take the changes you need.
WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server
- 이 부분은 위에서 수정해 주었다. #default-character-set = euckr 이게 문제였다...
이 후 다시 진행을 했더니 제대로 설치가 된 것 같았다.
이제 MySQL 를 실행해 보자
여기서는 아래 사이트를 참고하면서 진행 하였다.
참조 : http://jmkjb.tistory.com/entry/MySQL5621SetupSourceCompile
'MySQL' 카테고리의 다른 글
[MySQL] 빈로그 지우기 [펌] (0) | 2016.06.16 |
---|---|
[MySQL]5.6.31 source 설치 (3) - 완료 (0) | 2016.06.15 |
[MySQL]5.6.31 source 설치 (0) | 2016.06.13 |
[MySQL] Federated Engine (Table) (2) - 마무리 (0) | 2016.06.09 |
[MySQL] Federated Engine (Table) (1) | 2016.06.09 |