常规编译安装:./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. NN中的激活函数【转载】

    转自:https://blog.csdn.net/edogawachia/article/details/80043673 1.sigmoid 特点:可以解释,比如将0-1之间的取值解释成一个神经元的 ...

  2. [LeetCode] 110. Balanced Binary Tree_Easy tag: DFS

    Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary ...

  3. css页面布局--三栏(两边固定中间自适应&两边自适应中间固定)

    http://www.cnblogs.com/zhanyishu/p/5656875.html

  4. react native中使用 react-native-easy-toast 和react-native-htmlview

    第一步,下载依赖 npm install react-native-htmlview --save npm install react-native-easy-toast --save 第二步,引入 ...

  5. 编写一个程序解决选择问题。令k=N/2。

    import java.util.Arrays; /** * 选择问题,确定N个数中第K个最大值 * @author wulei * 将前k个数读进一个数组,冒泡排序(递减),再将剩下的元素逐个读入, ...

  6. redis的key越来越多,对速度是否有影响

    ---恢复内容开始--- redis存储key是用字典对象的,查询性能几乎和数量级无关,只要保证内存够用就可以了,如果内存不够,会把内存和swap空间交换,这种情况下就会很影响性能,会读取出现读取磁盘 ...

  7. shell文件的编写

    见文章http://www.cnblogs.com/handsomecui/p/5869361.html

  8. maven 知识

    1. maven 环境配置 Maven 3.3 要求 JDK 1.7 或以上   Maven 3.2 要求 JDK 1.6 或以上   Maven 3.0/3.1 要求 JDK 1.5 或以上 2. ...

  9. Unknown Treasure (卢卡斯 + 孙子定理, 模板题)

    Unknown Treasure 参考链接 : https://www.cnblogs.com/linyujun/p/5199684.html 卢卡斯定理 : C(n, m) % p  =  C(n ...

  10. mysql 查看版本和是否支持分区

    命令行界面: 查看版本: select version(); 结果: +------------+| version() |+------------+| 5.6.31-log |+--------- ...