mysql 5.6을 선택
참조: http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.3/bk_installing_manually_book/content/meet-min-system-requirements.html
https://dev.mysql.com/downloads/mysql/5.6.html#downloads
여기서 다운로드하기로...
설치 참조는 아래 링크로 진행해본다.
https://dev.mysql.com/doc/refman/5.6/en/linux-installation-rpm.html#mysql-installation-layout-linuxrpm
. MySQL 5.6깔기 전에 필요한 perl-Data-Dumper와 net-tools를 설치하고 메일보내는 postfix와 mariadb-libs를 삭제했다.
# yum -y install net-tools
# yum -y install perl-Data-Dumper
# rpm -e --allmatches postfix-2:2.10.1-6.el7.x86_64
# rpm -e --allmatches mariadb-libs-5.5.52-1.el7.x86_64
|
. server와 client 설치
# rpm -i MySQL-server-5.6.35-1.el7.x86_64.rpm
# rpm -i MySQL-client-5.6.35-1.el7.x86_64.rpm
|
. data폴더 변경하여 설치하기
# mkdir -p /data01/mysql
# cd /data01/mysql # chown mysql . # chgrp mysql . # cd /usr/bin
# ./mysql_install_db --datadir=/data01/mysql --user=mysql
|
. 기본 설정 파일 변경
# vi /usr/my.cnf
[mysqld]
...
datadir = /data01/mysql
character_set_server=utf8
# cat /root/.mysql_secret
|
. 초기 root 비밀번호 설정
# systemctl start mysql
# ./mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
... Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] y
... Success!
Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
... skipping.
By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] y
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] y
... Success!
All done! If you've completed all of the above steps, your MySQL
installation should now be secure.
Thanks for using MySQL!
Cleaning up...
혹시 로그인 실패 시 최초 비밀번호는 아래 파일에 담겨져 있다.
# cat /root/.mysql_secret
|
https://dev.mysql.com/doc/refman/5.6/en/data-directory-initialization.html
http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.3/bk_installing_manually_book/content/meet-min-system-requirements.html
. 원격접속 허용하기
# mysql -p
Enter password:Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.6.35 MySQL Community Server (GPL) Copyright (c) 2000, 2016, 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> select host,user from mysql.user; +---------------------------+------+ | host | user | +---------------------------+------+ | 127.0.0.1 | root | | ::1 | root | | bidevkylint1.bikylinclust | root | | localhost | root | +---------------------------+------+ 4 rows in set (0.00 sec) mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'; mysql> FLUSH PRIVILEGES; |
댓글 없음:
댓글 쓰기