CentOS 7 編譯安裝 MySQL 5.1

CentOS 7 編譯安裝 MySQL 5.1

一、概述

舊項目環境,沒辦法,只能重新搞一套。

環境:CentOS 7.6

二、安裝

1:下載包並解壓

wget http://mirrors.sohu.com/mysql/MySQL-5.1/mysql-5.1.73.tar.gz
tar xf mysql-5.1.73.tar.gz

2:安裝依賴

yum install -y ncurses ncurses-devel

3:添加用戶

groupadd mysql
useradd -M -s /sbin/nologin -g mysql mysql

4:編譯安裝

./configure  '--prefix=/usr/local/mysql' '--without-debug' '--with-charset=utf8' '--with-extra-charsets=all' '--enable-assembler' '--with-pthread' '--enable-thread-safe-client' '--with-mysqld-ldflags=-all-static' '--with-client-ldflags=-all-static' '--with-big-tables' '--with-readline' '--with-ssl' '--with-embedded-server' '--enable-local-infile' '--with-plugins=innobase'
make -j 4
make install

5:生成配置文件

mv /etc/my.cnf /etc/my.cnf.bak
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysqld
chkconfig --del mysqld
chkconfig --add mysqld
chkconfig mysqld on

6:初始化

chown -R mysql:mysql /usr/local/mysql
/usr/local/mysql/bin/mysql_install_db --user=mysql

7:啓動

chmod +x /etc/init.d/mysqld
service mysqld start

8:檢查

啓動成功。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章