您当前的位置: 首页 > 学无止境 > 心得笔记 网站首页心得笔记
马哥linux运维学习笔记-编译安装LAMP之MySQL-5.5.28(通用二进制格式)
发布时间:2019-02-08 09:10:21编辑:雪饮阅读()
解压源码到指定目录
[root@bogon src]# tar -xf mysql-5.5.28-linux2.6-i686.tar.gz -C /usr/local
[root@bogon src]# cd /usr/local
[root@bogon local]# mv mysql-5.5.28-linux2.6-i686 mysql
添加所需用户及授权
[root@bogon local]# groupadd -r -g 306 mysql
[root@bogon local]# useradd -g 306 -r -u 306 mysql
[root@bogon mysql]# chown -R mysql.mysql /usr/local/mysql/*
初始化数据
[root@bogon mysql]# scripts/mysql_install_db --user=mysql --datadir=/mydata/data
根据自己硬件配置拷贝合适的配置文件
[root@bogon mysql]# head support-files/my-large.cnf
# Example MySQL config file for large systems.
#
# This is for a large system with memory = 512M where the system runs mainly
# MySQL.
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
# http://dev.mysql.com/doc/mysql/en/option-files.html
[root@bogon mysql]# cp support-files/my-large.cnf /etc/my.cnf
根据自己cpu颗数配置/etc/my.cnf
查看cpu信息
[root@bogon mysql]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 78
model name : Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
stepping : 3
cpu MHz : 2400.219
cache size : 3072 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 22
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts mmx fxsr s se sse2 ss nx pdpe1gb rdtscp lm constant_tsc up ida nonstop_tsc arat pni ssse3 cx16 sse4_1 sse4_2 popcnt lah f_lm 3dnowprefetch [8]
bogomips : 4800.43
[root@bogon mysql]#
根据以上信息可知仅一颗cpu
# Try number of CPU's*2 for thread_concurrency
thread_concurrency = 2
修改数据存储目录
/etc/my.cnf
datadir=/mydata/data
启动mysql
[root@bogon mysql]# support-files/mysql.server start
Starting MySQL.. [ OK ]
mysql客户端
[root@bogon mysql]# bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.28-log MySQL Community Server (GPL)
Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
编译php5.4.13
编译注意事项:
apache的多路处理模块为event或worker则编译时需要有'--enable-maintainer-zts '
查看apache当前的多路处理模块
[root@bogon mysql]# /usr/local/apache/bin/httpd -M
AH00557: httpd: apr_sockaddr_info_get() failed for bogon
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
authn_file_module (shared)
authn_core_module (shared)
authz_host_module (shared)
authz_groupfile_module (shared)
authz_user_module (shared)
authz_core_module (shared)
access_compat_module (shared)
auth_basic_module (shared)
reqtimeout_module (shared)
filter_module (shared)
mime_module (shared)
log_config_module (shared)
env_module (shared)
headers_module (shared)
setenvif_module (shared)
version_module (shared)
mpm_event_module (shared)
unixd_module (shared)
status_module (shared)
autoindex_module (shared)
dir_module (shared)
alias_module (shared)
安装依赖
php5.4.13的i386编译需要依赖以下rpm
libmcrypt-2.5.7-5.el5.i386.rpm
libmcrypt-devel-2.5.7-5.el5.i386.rpm
mhash-0.9.2-6.el5.i386.rpm
mhash-devel-0.9.2-6.el5.i386.rpm
编译
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-openssl --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-mbstring --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --enable-sockets --with-apxs2=/usr/local/apache/bin/apxs --with-mcrypt --with-config-file-path=/tec --with-config-file-scan-dir=/etc/php.d --with-bz2 --enable-maintainer-zts
make
make install
关键字词:linux,lamp,mysql5.5.28
上一篇:马哥linux运维学习笔记-编译安装LAMP之httpd-2.4.4
下一篇:马哥linux运维学习笔记-编译安装LAMP之php-5.4.13、xcache-2.0及使用ab命令实现压力测试