一.安装cmake编译工具

跨平台编译器

查看是否已经安装了gcc

# rpm -qa | grep gcc

# yum install -y gcc-c++

# yum install -y cmake

# yum install -y git

解决依赖关系

# yum install -y readline-devel zlib-devel openssl-devel



Warning: Bison executable not found in PATH

 

解决方法:

#  yum install -y bison

再次编译即通过

二、编译安装mysql-5.5.48

# tar xf mysql-5.5.48.tar.gz

# cd mysql-5.5.48

# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mydata -DSYSCONFDIR=/etc -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_ZLIB=system -DWITH_LIBWRAP=0
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci





# make && make install





编译报错需要删除编译缓存

rm CMakeCache.txt

编译报错:

CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage

CMake Error: Internal CMake error, TryCompile configure of cmake failed

-- Looking for getpagesize - not found

-- Looking for TIOCGWINSZ

CMake Error at /usr/share/cmake/Modules/CMakeCInformation.cmake:37 (get_filename_component):

  get_filename_component called with incorrect number of arguments

Call Stack (most recent call first):

  CMakeLists.txt:3 (PROJECT)

安装gcc-c++即可

cmake . -- Running cmake version 2.8.10.2 -- Could NOT find Git (missing: GIT_EXECUTABLE) -- Configuring with MAX_INDEXES = 64U -- Looking for SHM_HUGETLB -- Looking for SHM_HUGETLB - found -- Looking for sys/types.h -- Looking for sys/types.h - found --
Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of void * -- Check size of void * - done -- SIZEOF_VOIDP 8 -- MySQL 5.7.9 -- Packaging as: mysql-5.7.9-Linux-x86_64 -- Looked for boost/version.hpp
in and -- BOOST_INCLUDE_DIR BOOST_INCLUDE_DIR-NOTFOUND -- LOCAL_BOOST_DIR -- LOCAL_BOOST_ZIP -- Could not find (the correct version of) boost. -- MySQL currently requires boost_1_59_0 CMake Error at cmake/boost.cmake:76 (MESSAGE): You can download it with
-DDOWNLOAD_BOOST=1 -DWITH_BOOST= This CMake script will look for boost in . If it is not there, it will download and unpack it (in that directory) for you. If you are inside a firewall, you may need to use an http proxy: export http_proxy=http://example.com:80
Call Stack (most recent call first): cmake/boost.cmake:228 (COULD_NOT_FIND_BOOST) CMakeLists.txt:435 (INCLUDE) -- Configuring incomplete, errors occurred!

安装git即可

三、新建存放Mysql数据库文件的逻辑卷并挂载到/data/mydata下

分区

# fdisk /dev/sda

n

p

3

+20G

w



#挂载系统分区

# kpartx -l /dev/sda

# kpartx -af /dev/sda

# partx -a /dev/sda

验证是否挂载成功

# cat /proc/partitions

创建物理卷

# pvcreate /dev/sda3

创建名为myvg的卷组

# vgcreate myvg /dev/sda3

#创建一个大小为15G,名字叫做mylv的逻辑卷

# lvcreate -L 15G -n mylv myvg

格式化

# mke2fs -t ext4 -b 2048 /dev/myvg/mylv







# mkdir -pv /data/mydata

mkdir: created directory ‘/data’

mkdir: created directory ‘/data/mydata’

# mount /dev/myvg/mylv /data/mydata

# vim /etc/fstab

添加如下内容:

/dev/myvg/mylv /data/mydataext4defaults,noatime 0 0



四、创建Mysql用户

添加mysql用户指定组id和用户id为306

# groupadd -r -g 306 mysql

# useradd -g mysql -r -g 306 -s /sbin/nologin mysql

# id mysql

uid=994(mysql) gid=306(mysql) groups=306(mysql)





改变数据存储目录和安装目录的权限

# cd /usr/local/mysql

添加存放日志的目录

# mkdir /data/binlogs

# chown -R :mysql ./*

# chown -R mysql.mysql /data/mydata

五、启动脚本初始化数据库

# scripts/mysql_install_db --user=mysql --datadir=/data/mydata

# cp support-files/mysql.server /etc/rc.d/init.d/mysqld

# cp support-files/my-large.cnf /etc/my.cnf





编辑/etc/my.cnf配置,加入以下内容

innodb_file_per_table = ON

datadir = /data/mydata

log-bin=/data/binlogs/mysql-bin

注意:

经过实际测试innodb_file_per_table = ON这条参数需要innodb_file_per_table = 1 才能生效,具体可以通过

mysql> show variables like '%per_table%';来查询





把mysqld服务加入到启动项

# chkconfig --add mysqld

# chkconfig --list mysqld





将mysql命令加入环境变量中

vim /etc/profile.d/mysql.sh

加入

export PATH=/usr/local/mysql/bin:$PATH





启动mysqld服务

# service mysqld start

报错

Starting MySQL. ERROR! The server quit without updating PID file (/data/mydata/oadb-test.pid).

# ss -tnl





可以观察日志/data/mydata/oadb-test.err,是日志创建权限的问题

# chown -R mysql.mysql /data

六、上传通达OA数据库并配置相关权限

上传通达OA数据库到服务器上,修改权限,并重启服务,测试





# chown -R mysql.mysql /data/mydata

# service mysqld restart



对mysql数据库用户进行清理,加密码

mysql> use mysql
Database changed
mysql> select user,host,password from user;
+------+-----------+----------+
| user | host | password |
+------+-----------+----------+
| root | localhost | |
| root | adb-test | |
| root | 127.0.0.1 | |
| root | ::1 | |
| | localhost | |
| | adb-test | |
+------+-----------+----------+
6 rows in set (0.01 sec) mysql> delete from user where user='' and host='localhost';
Query OK, 1 row affected (0.01 sec) mysql> delete from user where user='' and host='adb-test';
Query OK, 1 row affected (0.00 sec)

设置其中root密码为myoa888,并对服务器IP限制

mysql> update user set password=PASSWORD('myoa888'),host='192.168.11.144' where user='root' and host='::1';

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0



对root用户加密

mysql> update user set password=PASSWORD('13C1325E831DEC8D60') where user='root' and host in('localhost','adb-test','127.0.0.1');
mysql> select user,host,password from user;
+------+----------------+-------------------------------------------+
| user | host | password |
+------+----------------+-------------------------------------------+
| root | localhost | *CF51F9E245F41378E51B4154082F26108A5B0D63 |
| root | adb-test | *CF51F9E245F41378E51B4154082F26108A5B0D63 |
| root | 127.0.0.1 | *CF51F9E245F41378E51B4154082F26108A5B0D63 |
| root | 192.168.11.144 | *91AF99F23C3D4ED85140D100433725DFA52BECEE |
+------+----------------+-------------------------------------------+

centos7关闭防火墙命令

# systemctl stop firewalld.service



systemctl start firewalld.service#启动firewall

systemctl disable firewalld.service#禁止firewall开机启动

centos7.2环境编译安装mysql5.5.48的更多相关文章

  1. centos7.6环境编译安装php-7.2.24修复最新 CVE-2019-11043 漏洞

    先编译安装php-7.2.24,然后编译安装扩展 主版本地址地址:https://www.php.net/distributions/php-7.2.24.tar.gz # 编译 php-7.2.24 ...

  2. Centos7.4 版本环境下安装Mysql5.7操作记录

    Centos7.x版本下针对Mysql的安装和使用多少跟之前的Centos6之前版本有所不同的,废话就不多赘述了,下面介绍下在centos7.x环境里安装mysql5.7的几种方法: 一.yum方式安 ...

  3. centos6.5环境源码编译安装mysql5.6.34

    centos6.5环境源码编译安装mysql5.6.34 源码下载地址http://dev.mysql.com/downloads/mysql/5.6.html#downloads 选择Generic ...

  4. centos7编译安装MySQL5.7.9

    title: centos7编译安装MySQL5.7.9 date: 2016-05-12 16:20:17 tags: --- Centos7编译安装mysql5.7.9 mysql5.7有更好的性 ...

  5. CentOS-7.3.1611编译安装 Nginx-1.12.1+mysql-5.7.19+PHP-7.1.8+zabbix-3.4.1

    CentOS-7.3.1611编译安装 Nginx-1.12.1+mysql-5.7.19+PHP-7.1.8+zabbix-3.4.1 下载软件 1.下载nginx http://nginx.org ...

  6. CentOS7 编译安装MySQL5.6.38(一)

    一.下载MySQL5.6.38安装包 下载地址:https://www.mysql.com/downloads/  打开网站之后选择Archives 然后再选择开源版本 选择我们要下载的版本: htt ...

  7. Centos7之LNMP环境编译安装

    Centos7之LNMP环境编译安装 一.系统环境准备 注:安装时间过长,只做参考!!!1.系统信息 [root@localhost ~]# uname -r 3.10.0-957.el7.x86_6 ...

  8. Centos7源码编译安装PHP7.2(生产环境)

    安装PHP依赖包,否则在编译的过程中可能会出现各种报错 # Centos 安装epel-release源并将系统包更新到最新版本 $ yum install epel-release-y $ yum ...

  9. RPM方式安装MySQL5.5.48 (Aliyun CentOS 7.0 & 卸载MySQL5.7)

    环境是阿里云的CentOS7.0,更新了yum源(更新yum源请参考https://help.aliyun.com/knowledge_detail/5974184.html)之后先是尝试安装了MyS ...

随机推荐

  1. Linux中配置Aria2 RPC Server

    启动Aria2 RPC Server 直接在终端中执行aria2c --enable-rpc --rpc-allow-origin-all可直接开启RPC服务. 这种方法并不能进行个性化的参数设置,需 ...

  2. HDU 1024 Max Sum Plus Plus (动态规划)

    HDU 1024 Max Sum Plus Plus (动态规划) Description Now I think you have got an AC in Ignatius.L's "M ...

  3. A1080. Graduate Admission

    It is said that in 2013, there were about 100 graduate schools ready to proceed over 40,000 applicat ...

  4. python并发编程之IO模型 (四十九)

    IO模型介绍 http://www.cnblogs.com/linhaifeng/articles/7454717.html

  5. for master

    冒泡排序 Bubble sort function bubleSort(){ var array=[1,8,9,3,2,5,4]; console.log('冒泡排序前',array); for(va ...

  6. NOIP 普及组 2014 珠心算测验

    传送门 https://www.cnblogs.com/violet-acmer/p/9898636.html 题解: 枚举两两间出所有的可能加和,然后遍历一遍这 n 个数,找出满足条件的总个数. 这 ...

  7. linux command ------ ls

    -rw-r--r-- [d]: content [-]: file [l]: link file [b]: interface device for storage in a device file ...

  8. golang切片数据结构解释

    1. 切片:切片是数组的一个引用,因此切片是引用类型 func main() { var arr = [6]int{1, 2, 3, 4, 5} var slice = arr[1:] fmt.Pri ...

  9. minio上传大于30M文件失败

    minio上传30M文件失败.提示失败或者进度不动.翻查手册发现并未限速.原因是使用了nginx做代理.上传超过30M大的客户端文件无法正常上传,修改了下nginx的配置,就可以了. 加上client ...

  10. ubuntu16.04.1下安装mysql

    版本信息 ubuntu版本:16.04.1 mysql-server版本:5.7.23 安装 先查看一下apt可获取的mysql版本 ubuntu@VM-0-4-ubuntu:~$ apt searc ...