centos 7 源码编译安装Apache、php(5.6.30)、mysql(5.5)

使用的主机为:阿里云2核8G5M

使用的系统为:centos 7.5 x64(CentOS Linux release 7.5.1804 (Core))


mysql 5.5.62

mysql官方下载:https://dev.mysql.com/downloads/mysql/

本次使用的mysql 5.5.62:https://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.62.tar.gz

yum install make *curses* gcc gcc44* gcc-c++ gcc-g77 cmake -y
mkdir -p /data/mysql
wget https://cdn.mysql.com//Downloads/MySQL-5.5/mysql-5.5.62.tar.gz
tar zxvf mysql-5.5.62.tar.gz
cd mysql-5.5.62
/usr/bin/cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql/ -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DSYSCONFDIR=/etc -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 -DWITH_XTRADB_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 -DWITH_EXTRA_CHARSETS=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DEXTRA_CHARSETS=all -DWITH_BIG_TABLES=1 -DWITH_DEBUG=0
make
make install
mv /etc/my.cnf /etc/my.cnf.bak
cp /usr/local/mysql/support-files/my-medium.cnf  /etc/my.cnf
/usr/local/mysql/scripts/mysql_install_db --user=root --basedir=/usr/local/mysql/ --datadir=/data/mysql/ --defaults-file=/etc/my.cnf
vi /etc/my.cnf
my.cnf内容:
###############################################
# The MySQL server
[mysqld]
datadir=/data/mysql                //添加这一行
user            = root             //添加这一行
port            = 3306
socket          = /data/mysql/mysql.sock
skip-external-locking

###############################################
cp -f /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqld
chkconfig --add mysqld
chkconfig mysqld on

#做链接
ln -s /usr/local/mysql/bin/mysql /usr/bin
ln -fs /usr/local/mysql/bin/mysqldump /usr/bin
ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18
ln -s /usr/local/mysql/bin/mysql /usr/local/bin/mysql
ln -s /usr/local/mysql/bin/mysqlimport /usr/local/bin/mysqlimport
ln -s /usr/local/mysql/bin/mysqldump /usr/local/bin/mysqldump
ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config
ln -s /usr/local/mysql/bin/mysqladmin  /usr/bin/
ln -s /usr/local/mysql/include/* /usr/local/include/

 

mysql编译安装完成!

 

Apache

待添加

 

 

 

 

 

 

php 5.6.30

待添加

 

 

参考:

https://www.cnblogs.com/mingerlcm/p/6792503.html

https://www.cnblogs.com/dreamhome/p/4967903.html

 

赞(0) 人间有温暖
未经允许不得转载:搜查记 » centos 7 源码编译安装Apache、php(5.6.30)、mysql(5.5)
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

文章滞销帮帮我们

支付宝扫一扫打赏

微信扫一扫打赏