mysql8.0.12最小化安装_简述MySql8.0编译安装过程
[[email?protected] ~]# cat /etc/redhat-release
CentOS Linux release 8.0.1905 (Core)
注意:不要用8以下的系統編譯MySQL8,會存在各個工具版本不夠高的各種報錯,非常麻煩
Mysql版本
mysql-8.0.18
第一步:安裝依賴包
[[email?protected] mysql]# wget https://github.com/thkukuk/rpcsvc-proto/releases/download/v1.4/rpcsvc-proto-1.4.tar.gz
[[email?protected] mysql]# tar -xzf rpcsvc-proto-1.4.tar.gz
[[email?protected] mysql]# cd rpcsvc-proto-1.4/
[[email?protected] rpcsvc-proto-1.4]# ./configure
[[email?protected] rpcsvc-proto-1.4]# make && make install
安裝其他依賴
yum install -y ncurses-devel cmake gcc perl-Data-Dumper gcc-c++ git openssl-devel make
解壓
tar -xzf mysql-boost-8.0.18.tar.gz
cd mysql-8.0.18/
第三步:編譯安裝
檢查
[[email?protected] mysql-8.0.18]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DFORCE_INSOURCE_BUILD=1 -DWITH_BOOST=boost/
開始編譯安裝
[[email?protected] mysql-8.0.18]# make -j 4 && make install
可能會存在的報錯:
-- 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!
See also "/root/mysql/mysql-8.0.18/CMakeFiles/CMakeOutput.log".
解決辦法:
[[email?protected] mysql-8.0.18]# yum install -y make
報錯:
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),
**
解決辦法:
[[email?protected] mysql-8.0.18]# yum install -y openssl-devel
報錯:
-- 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)
解決辦法:
[[email?protected] mysql-8.0.18]# yum install -y libtirpc-devel
第四步:配置
新建數據存放目錄
[[email?protected] mysql-8.0.18]# mkdir /data/mysql -p
[[email?protected] mysql-8.0.18]# chown mysql:mysql /data/mysql/
[[email?protected] mysql-8.0.18]# chown mysql:mysql -R /usr/local/mysql/
[[email?protected] mysql-8.0.18]# cp support-files/mysql.server /usr/local/sbin/
[[email?protected] mysql-8.0.18]# chmod 755 /usr/local/sbin/mysql.server
[[email?protected] mysql-8.0.18]# /usr/local/mysql/bin/mysqld --initialize --user=mysql
啟動數據庫
[[email?protected] mysql-8.0.18]# mysql.server start
Starting MySQL... SUCCESS!
配置環境變量
[[email?protected] mysql-8.0.18]# echo ‘PATH=/usr/local/mysql/bin:$PATH‘ >> /etc/profile
[[email?protected] mysql-8.0.18]# source /etc/profile
第五步:登錄
找到臨時密碼
[[email?protected] mysql-8.0.18]# grep password /data/mysql/error.log | grep root
2020-01-09T22:18:59.395962+08:00 5 [Note] [MY-010454] [Server] A temporary password is generated for [email?protected]: MYtoDe(>o6i&
修改臨時root密碼
[[email?protected] mysql-8.0.18]# mysqladmin -u root -p password "[email?protected]"
Enter password:
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
用root登錄
[[email?protected] mysql-8.0.18]# mysql -p
Enter password:
第六步:新建數據庫并授權用戶
注:Mysql 從8.0起就不能把授權數據庫和新建用戶放到一條命令了
新建testdb數據庫
[email?protected] 22:30: [(none)]> create database testdb;
Query OK, 1 row affected (0.01 sec)
新建testuser用戶并設置密碼
[email?protected] 22:35: [(none)]> create user [email?protected] identified by ‘huH345sfrfs‘;
Query OK, 0 rows affected (0.01 sec)
授權
[email?protected] 22:36: [(none)]> grant all privileges on testdb.* to [email?protected];
Query OK, 0 rows affected (0.00 sec)
原文:https://blog.51cto.com/niubdada/2465698
總結
以上是生活随笔為你收集整理的mysql8.0.12最小化安装_简述MySql8.0编译安装过程的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java map 输入 查询 修改_My
- 下一篇: 精子活力低会流产吗