常规编译安装:./configure;make;make install

linux系统centos 6.5,mysql版本5.5.54,所需安装包cmake-2.8.8.tar.gz、mysql-5.5.54.tar.gz、ncurses-devel-5.7-4.20090207.el6.x86_64.rpm

查看linux系统信息

[root@oldboy ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
[root@oldboy ~]# uname -a
Linux oldboy 2.6.-.el6.x86_64 # SMP Fri Nov :: UTC x86_64 x86_64 x86_64 GNU/Linux

挂载磁盘并安装gcc-c++

[root@oldboy ~]# mount /dev/cdrom /mnt
mount: block device /dev/sr0 is write-protected, mounting read-only
[root@oldboy ~]# yum -y install gcc-c++

如果没有安装gcc-c++,后面./configure时会报如下错误

---------------------------------------------
Error when bootstrapping CMake:
Cannot find appropriate C++ compiler on this system.
Please specify one using environment variable CXX.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /usr/local/cmake-3.0./Bootstrap.cmk/cmake_bootstrap.log

创建更新包目录,并将三个安装包上传至该目录下,赋予执行权限

[root@oldboy ~]# mkdir -p /home/oldboy/tools
[root@oldboy ~]# cd /home/oldboy/tools
[root@oldboy tools]# chmod +x *

安装ncurses-devel

[root@oldboy tools]# yum -y install ncurses-devel-5.7-4.20090207.el6.x86_64.rpm
…………………
Complete!

安装cmake

[root@oldboy tools]# tar zxf cmake-2.8..tar.gz
[root@oldboy tools]# cd cmake-2.8.
[root@oldboy cmake-2.8.]# ./configure
…………………
CMake has bootstrapped. Now run gmake.
[root@oldboy cmake-2.8.]# gmake
……………………
[%] Built target foo
[root@oldboy cmake-2.8.]# gmake install
……………………
-- Installing: /usr/local/doc/cmake-2.8/cpack.docbook
-- Installing: /usr/local/share/aclocal/cmake.m4

安装mysql,make&&make install 耗时较长

[root@oldboy tools]# groupadd mysql
[root@oldboy tools]# useradd -M mysql -g mysql -s /sbin/nologin
[root@oldboy tools]# tar zxf mysql-5.5..tar.gz
[root@oldboy tools]# cd mysql-5.5.
[root@oldboy mysql-5.5.]# cmake . -DCMAKE_INSTALL_PREFIX=/application/mysql-5.5. \
-DMYSQL_DATADIR=/application/mysql-5.5./data \
-DMYSQL_UNIX_ADDR=/application/mysql-5.5./tmp/mysql.sock \
-DEXTRA_CHARSETS=gbk,gb2312,utf8,ascii \
-DENABLED_LOCAL_INFILE=ON \
-DWITH_INNOBASE_STORAGE_ENGINE= \
-DWITH_FEDERATED_STORAGE_ENGINE= \
-DWITH_BLACKHOLE_STORAGE_ENGINE= \
-DWITHOUT_EXAMPLE_STORAGE_ENGINE= \
-DWITHOUT_PARTITION_STORAGE_ENGINE= \
-DWITH_FAST_MUTEXES= \
-DWITH_ZLIB=bundled \
-DENABLED_LOCAL_INFILE= \
-DWITH_READLINE= \
-DWITH_EMBEDDED_SERVER= \
-DWITH_DEBUG=
……………………
-- Configuring done
-- Generating done
-- Build files have been written to: /home/oldboy/tools/mysql-5.5.
[root@oldboy mysql-5.5.]# make && make install
……………………
-- Installing: /application/mysql-5.5./man/man1/my_print_defaults.
-- Installing: /application/mysql-5.5./man/man8/mysqld.
[root@oldboy mysql-5.5.]# ll /application/mysql/data/
总用量
drwxr-xr-x. root root 6月 : test

创建软连接、复制mysql的配置文件到/etc/my.cnf文件,并将mysql的可执行文件bin目录加入PATH环境变量

[root@oldboy mysql-5.5.]# ln -s /application/mysql-5.5./ /application/mysql
[root@oldboy mysql-5.5.]# cp support-files/my-small.cnf /etc/my.cnf
cp: overwrite `/etc/my.cnf'? y
[root@oldboy mysql-5.5.]# echo 'export PATH=/application/mysql/bin:$PATH'>>/etc/profile
[root@oldboy mysql-5.5.]# source /etc/profile
[root@oldboy mysql-5.5.]# echo $PATH
/application/mysql/bin:/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

修改安装目录的权限,并编译安装,出现两个ok表示此步骤没有问题

[root@oldboy mysql-5.5.]# chown -R mysql.mysql /application/mysql/data/
[root@oldboy mysql-5.5.]# chmod -R /tmp/
[root@oldboy mysql-5.5.]# cd /application/mysql/scripts/
[root@oldboy scripts]# ./mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql
……………………
Installing MySQL system tables...
:: [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
:: [Note] /application/mysql//bin/mysqld (mysqld 5.5.54) starting as process 48267 ...
OK
Filling help tables...
:: [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
:: [Note] /application/mysql//bin/mysqld (mysqld 5.5.54) starting as process 48274 ...
OK
……………………
Please report any problems at http://bugs.mysql.com/

复制mysql的启动文件到/etc/init.d/下并命名为mysqld

[root@oldboy scripts]# cd /home/oldboy/tools/mysql-5.5.
[root@oldboy mysql-5.5.]# cp support-files/mysql.server /etc/init.d/mysqld
[root@oldboy mysql-5.5.]# chmod +x /etc/init.d/mysqld
[root@oldboy mysql-5.5.]# mkdir -p /application/mysql-5.5./tmp
[root@oldboy mysql-5.5.]# chown -R mysql.mysql /application/mysql-5.5./tmp

启动mysql

[root@oldboy mysql-5.5.]# /etc/init.d/mysqld start
Starting MySQL.Logging to '/application/mysql-5.5.54/data/oldboy.err'.
.[ OK ]

给root用户设置密码并通过root登录mysql数据库

[root@oldboy mysql-5.5.]# /application/mysql//bin/mysqladmin -u root password 'oldboy'
[root@oldboy mysql-5.5.]# mysql -uroot -poldboy
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.5. Source distribution Copyright (c) , , 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>

centos6编译安装mysql5.5的更多相关文章

  1. CentOS6.3 编译安装LAMP(3):编译安装 MySQL5.5.25

    所需源码包: /usr/local/src/MySQL-5.5.25/cmake-2.8.8.tar.gz /usr/local/src/MySQL-5.5.25/mysql-5.5.25.tar.g ...

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

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

  3. centos6.7下 编译安装MySQL5.7

    centos6.7下编译安装MySQL5.7 准备工作 #-----依赖包及MySQL和boost安装包----- #yum包安装: shell> yum -y install gcc-c++ ...

  4. centos6.7编译安装mysql5.7.17

    centos6.7编译安装mysql5.7.17 2017-03-24 09:57:15 提示:mysql5.7.17和之前5.56以前的版本安装不一样,需要用cmake 另外,看本文档的mysql编 ...

  5. CentOS6.5_64bit下编译安装MySQL-5.6.23

    转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/44785511 ************************************** ...

  6. centos6.6下编译安装mysql5.6之后启动失败:Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysql/localhost.localdomain.pid).

    今天在编译安装mysql5.6时候出现Starting MySQL... ERROR! The server quit without updating PID file (/var/lib/mysq ...

  7. CentOS6.9 下编译安装MySQL5.7.19

    官网:https://www.mysql.com/ 下载地址:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19.tar.gz 一.准备工作 ...

  8. centos7编译安装MySQL5.7.9

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

  9. Linux源码编译安装MySQL5.7

    目录[-] 一.环境准备: 二.升级系统: 三.做一些准备工作(以下Linux命令均在su到root用户操作): 四.开始编译安装mysql-5.7.9: 一.环境准备: 我尝试过以下环境都是能成功的 ...

随机推荐

  1. sklearn.svm.LinearSVC文档学习

    https://scikit-learn.org/stable/modules/generated/sklearn.svm.LinearSVC.html#sklearn.svm.LinearSVC 1 ...

  2. vue proxyTable 跨域问题。

  3. 解决bug感觉

    解决bug,没有思路,很烦躁: 时间过去好久,还是没头绪,没结论: ...... ...... ...... ...... ...... 过了好久,这样还不如冷静下来,按照正确的方法(review代码 ...

  4. 16-Python3 条件控制

    2018-11-20 11:41:15 print('狗狗的年龄兑换*********************************************************') age = ...

  5. 特征选择:Filter/Wrapper/Embedded

    一.特征的来源 在做数据分析的时候,特征的来源一般有两块,一块是业务已经整理好各种特征数据,我们需要去找出适合我们问题需要的特征:另一块是我们从业务特征中自己去寻找高级数据特征.我们就针对这两部分来分 ...

  6. kdeplot(核密度估计图) & distplot

    Seaborn是基于matplotlib的Python可视化库. 它提供了一个高级界面来绘制有吸引力的统计图形.Seaborn其实是在matplotlib的基础上进行了更高级的API封装,从而使得作图 ...

  7. 多么痛的领悟---关于RMB数据类型导致的元转分分转元的bug

    关于金额的数据类型,以及元转分分转元之间这种转换,以及元和分的比较,我相信很多人都踩过坑. 反正我是踩过. 而且,昨天和今天又重重的踩了两脚. 代付查询接口,支付中心给溢+响应的报文里,amount的 ...

  8. nodejs爬虫数据存入mysql

    node爬虫主要用的是三个插件 request cheerio mysql 废话不多说直接上代码 const request=require("request") const ch ...

  9. ZOJ 3690 Choosing number(矩阵)

    Choosing number [题目链接]Choosing number [题目类型]矩阵 &题解: 这题就和已经dp极像了,所以找方程就很困难了.可以这样找: 设f(n)是前n-1个人已经 ...

  10. JAVA_Stream_练习

    package airycode_java8.nice7; import airycode_java8.nice1.Employee; import org.junit.Test; import ja ...