卸载源码安装mysql_CentOS7下源码安装MySQL5.7.6+
卸載CentOS7默認攜帶的mariadb包
# 檢查mariadb安裝包
[root@wing ~]# rpm -qa | grep -i mysql
[root@wing ~]# rpm -qa | grep -i mariadb
mariadb-libs-5.5.50-1.el7_2.x86_64
# 卸載mariadb安裝包
[root@wing ~]# rpm -e mariadb-libs-5.5.50-1.el7_2.x86_64
error: Failed dependencies:
libmysqlclient.so.18()(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by (installed) postfix-2:2.10.1-6.el7.x86_64
[root@wing ~]# rpm -e mariadb-libs-5.5.50-1.el7_2.x86_64 postfix-2:2.10.1-6.el7.x86_64
安裝編譯軟件
yum install -y cmake make gcc gcc-c++
創建MySQL安裝目錄
# 如MySQL安裝目錄為:/usr/local/mysql
mkdir -p /usr/local/mysql
解壓MySQL源碼包
tar -zxvf mysql-5.7.16.tar.gz
創建mysql用戶和用戶組
# 創建用戶組
groupadd mysql
# 創建mysql用戶,所屬組為mysql
useradd -s /bin/bash -m -g mysql mysql
安裝MySQL相關依賴包
yum install -y ncurses-devel openssl-devel bison-devel libaio libaio-devel
boost庫安裝
# 該步驟可以省略,在cmake階段添加參數-DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boost即可
# boost庫安裝
wget http://sourceforge.net/projec...
tar -zxvf boost_1_59_0.tar.gz -C /usr/local
mv /usr/local/boost_1_59_0 /usr/local/boost
cd /usr/local/boost
./bootstrap.sh
./b2 stage threading=multi link=shared
./b2 install threading=multi link=shared
創建MySQL相關目錄
目錄 含義 配置參數
bin_log 二進制日志目錄 log_bin_basename
log_bin_index
mydata 數據文件目錄 datadir
innodb_log InnoDB重做日志目錄 innodb_log_group_home_dir
innodb_ts InnoDB共享表空間目錄 innodb_data_home_dir
log 日志文件目錄(error log+general log+slow log) log_error
general_log_file
slow_query_log_file
relay_log InnoDB中繼日志目錄 relay_log_basename
relay_log_index
tmpdir 臨時文件目錄 tmpdir
undo_log InnoDB回滾日志目錄 innodb_undo_directory
mkdir -p /data/mysql/mysql3306/bin_log
mkdir -p /data/mysql/mysql3306/db_file
mkdir -p /data/mysql/mysql3306/innodb_log
mkdir -p /data/mysql/mysql3306/innodb_ts
mkdir -p /data/mysql/mysql3306/log
mkdir -p /data/mysql/mysql3306/relay_log
mkdir -p /data/mysql/mysql3306/tmpdir
mkdir -p /data/mysql/mysql3306/undo_log
修改步驟9創建的目錄的所屬用戶與所屬組為mysql:mysql
chown -R mysql:mysql /data/mysql/mysql3306
將MySQL配置文件my.cnf放置到/etc目錄下
總結
以上是生活随笔為你收集整理的卸载源码安装mysql_CentOS7下源码安装MySQL5.7.6+的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: java将字体输出成图片格式_JAVA
- 下一篇: 计算机原理 信息化教学设计,小学数学信