常规编译安装:./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. redis集群redis-cloud搭建

    Redis集群中至少应该有三个节点.要保证集群的高可用,需要每个节点有一个备份机.Redis集群至少需要6台服务器. 搭建伪分布式.可以使用一台虚拟机运行6个redis实例.需要修改redis的端口号 ...

  2. 30.get和post的区别

    POST和GET的区别 Http定义了与服务器交互的不同方法,最基本的方法有4种,分别是GET,POST,PUT,DELETE.URL全称是资源描述符,我们可以这样认为:一个URL地址,它用于描述一个 ...

  3. sqli-labs(十六)(order by注入)

    第四十六关: http://www.bubuko.com/infodetail-2481914.html 这有篇文章讲得还不错可以看下 这关是order by后面的一个注入,用报错注入和盲注都是可以的 ...

  4. Koa中使用cookies

    错误重现:(使用ctx.cookies.set时报错) 这是因为koa的http的header字符集支持US-ASCII子集的字符集,故设置中文是'utf8'时就会报上面错误 解决方法有两种: 1.  ...

  5. 解决React Native使用Fetch API请求网络报Network request failed

    问题来源: 1 . 在测试fetch数据请求时,Xcode9.0以上的无法请求https, 需要在Xcode中加载项目后修改Info.plist的相关配置,具体如下参考 问题及解决方法一模一样,不再重 ...

  6. DoTween

    dotween最原始的用法 using System.Collections; using System.Collections.Generic; using UnityEngine; using D ...

  7. Java包装

    public class Test2 { public static void main(String[] args) { /*String str = "..............&qu ...

  8. 05 enumerate index使用

    # enumerate 自动生成一列, 默认0开始,每次自增+1li = ["电脑","鼠标垫","U盘","游艇"]f ...

  9. Boss Bo (主席树)

    主要想法:假设给你足够时间,那么就可以对每个点建议一颗线段树来查询了,但是需要将点全部按照某个特定的序列存进线段树,如代码是以树的深搜顺序作为指定顺序,这样以来我们既可以将数据查询分成诺干个区间进行查 ...

  10. [博客迁移]探索Windows Azure 监控和自动伸缩系列2 - 获取虚拟机的监控定义和监控数据

    上一篇博文介绍了如何连接Windows Azure: http://www.cnblogs.com/teld/p/5113063.html 本篇我们继续上次的示例代码,获取虚拟机的监控定义和监控数据. ...