일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
- 전자정부 표준프레임워크
- MySQL
- Tibero
- String Function and Operators
- String Functions and Date Operators
- SVN
- Oracle
- String Functions and Operators
- HTTP
- Data and Time Functions
- 방화벽
- Date and Time Function
- Date and Time Functions
- 티베로
- 전자정부표준프레임워크
- Sring Functions and Operators
- 윈도우
- 오라클
- Today
- Total
웹이야기
6. MySQL 설치(소스 컴파일, 5.7, 8.x 버전) 본문
OS : Cent Os CentOS Linux release 8.0.1905 (Core)
MySQL : MySQL-8.0.18 또는 MySQL5.7.28
#ps -ef | grep mysql
#rpm -qa | grep mysql
#cd /usr/local/src
#wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.18.tar.gz
#tar xvzf mysql-8.0.18.tar.gz
#cd mysql-8.0.18/
#mkdir build_20200109
#cd build_20200109/
#cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DMYSQL_DATADIR=/usr/local/mysql_data -DENABLED_LOCAL_INFILE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1cmake ../ -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DSYSCONFDIR=/etc -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost -DMYSQL_UNIX_ADDR=/var/lib/mysql/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS=all -DMYSQL_DATADIR=/usr/local/mysql_data -DENABLED_LOCAL_INFILE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_FEDERATED_STORAGE_ENGINE=1 -DWITH_DEBUG=0 -DMYSQL_MAINTAINER_MODE=0 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_TCP_PORT=3306 -DENABLE_DOWNLOADS=1
bash: cmake: 명령을 찾을 수 없습니다...
#yum -y install cmake
#cmake ~~~~
-- Running cmake version 3.11.4
-- Could NOT find Git (missing: GIT_EXECUTABLE)
-- MySQL 8.0.18
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
#yum -y install git
#cmake ~~~~
-- Running cmake version 3.11.4
-- Found Git: /usr/bin/git (found version "2.18.1")
-- MySQL 8.0.18
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
#yum -y install make
#cmake ~~~~
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:311 (PROJECT):
No CMAKE_C_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
the compiler, or to the compiler name if it is in the PATH.
CMake Error at CMakeLists.txt:311 (PROJECT):
No CMAKE_CXX_COMPILER could be found.
Tell CMake where to find the compiler by setting either the environment
variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
to the compiler, or to the compiler name if it is in the PATH.
#yum -y install gcc*
#cmake ~~~~
Cannot find appropriate system libraries for WITH_SSL=system.
Make sure you have specified a supported SSL version.
Valid options are :
system (use the OS openssl library),
yes (synonym for system),
</path/to/custom/openssl/installation>
CMake Error at cmake/ssl.cmake:65 (MESSAGE):
Please install the appropriate openssl developer package.
Call Stack (most recent call first):
cmake/ssl.cmake:293 (FATAL_SSL_NOT_FOUND_ERROR)
CMakeLists.txt:1181 (MYSQL_CHECK_SSL)
#yum -y install openssl-devel
#cmake ~~~~
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:71 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:100 (FIND_CURSES)
cmake/readline.cmake:194 (MYSQL_USE_BUNDLED_EDITLINE)
CMakeLists.txt:1185 (MYSQL_CHECK_EDITLINE)
#yum -y install ncurses-devel
#cmake ~~~~
-- Found PkgConfig: /usr/bin/pkg-config (found version "1.4.2")
-- Checking for module 'libtirpc'
-- Package 'libtirpc', required by 'virtual:world', not found
CMake Error at cmake/rpc.cmake:65 (MESSAGE):
Could not find rpc/rpc.h in /usr/include or /usr/include/tirpc
Call Stack (most recent call first):
plugin/group_replication/libmysqlgcs/configure.cmake:57 (MYSQL_CHECK_RPC)
plugin/group_replication/libmysqlgcs/CMakeLists.txt:28 (INCLUDE)
-- Configuring incomplete, errors occurred!
#yum -y install libtirpc-devel
#cmake ~~~~
CMake Error at plugin/group_replication/libmysqlgcs/rpcgen.cmake:100 (MESSAGE):
Could not find rpcgen
Call Stack (most recent call first):
plugin/group_replication/libmysqlgcs/CMakeLists.txt:38 (INCLUDE)
#yum --enablerepo=PowerTools install rpcgen
#cmake ~~~~
#make
#make install
#groupadd mysql
#useradd -r -g mysql -s /bin/false mysql
#cd /usr/local/
#mkdir mysql_data
#chown -R mysql.mysql mysql_data/
#chmod 750 mysql_data/
#mkdir /var/lib/mysql
#chown -R mysql.mysql /var/lib/mysql
#chmod 750 /var/lib/mysql
#cd /usr/local/mysql/bin
#/usr/local/mysql/bin/mysqld --initialize-insecure --basedir=/usr/local/mysql --datadir=/usr/local/mysql_data --user=mysql
-- 위와 같이 하면 root 비밀번호를 생성하지 않는다.
root 비밀번호를 생성하려면 다음과 같이 한다. -insecure 부분이 빠진다.
#/usr/local/mysql/bin/mysqld --initialize --basedir=/usr/local/mysql --datadir=/usr/local/mysql_data --user=mysql
이와 같이 하면 메세지에 임의의 root 비밀번호가 정해지고 그것이 아래와 같이 출력된다.
[Note] [MY-010454] [Server] A temporary password is generated for root@localhost: Z-qdwvkr,76>
위와 같이 요상해보이는 것이 root 비밀번호이다. 이걸 계속 사용하기는 어려우니 비밀번호를 변경하는 것이 좋을 것 같다. 아래 명령어를 마저 실행한 후에 MySQL 데몬을 띄우고 나서 root 비밀번호를 변경한다.
#./mysql_ssl_rsa_setup
#./mysqld_safe --user=mysql &
root 비밀번호를 변경하는 것은 아래 URL을 참조한다.
'D > MySQL' 카테고리의 다른 글
8. Installing MySQL on Linux Using the MySQL Yum Repository (0) | 2020.01.11 |
---|---|
7. MySQL root 패스워드 변경 (0) | 2020.01.11 |
5. MySQL 설치(리눅스) - 소스 컴파일 (1) | 2020.01.08 |
4. MySQL 설치(리눅스) - yum 으로 설치 (0) | 2020.01.08 |
3. MySQL 다운로드 (0) | 2020.01.07 |