centos6编译安装mysql5.5
常规编译安装:./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的更多相关文章
- 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 ...
- centos6.5环境源码编译安装mysql5.6.34
centos6.5环境源码编译安装mysql5.6.34 源码下载地址http://dev.mysql.com/downloads/mysql/5.6.html#downloads 选择Generic ...
- centos6.7下 编译安装MySQL5.7
centos6.7下编译安装MySQL5.7 准备工作 #-----依赖包及MySQL和boost安装包----- #yum包安装: shell> yum -y install gcc-c++ ...
- centos6.7编译安装mysql5.7.17
centos6.7编译安装mysql5.7.17 2017-03-24 09:57:15 提示:mysql5.7.17和之前5.56以前的版本安装不一样,需要用cmake 另外,看本文档的mysql编 ...
- CentOS6.5_64bit下编译安装MySQL-5.6.23
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/44785511 ************************************** ...
- 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 ...
- CentOS6.9 下编译安装MySQL5.7.19
官网:https://www.mysql.com/ 下载地址:https://cdn.mysql.com//Downloads/MySQL-5.7/mysql-5.7.19.tar.gz 一.准备工作 ...
- centos7编译安装MySQL5.7.9
title: centos7编译安装MySQL5.7.9 date: 2016-05-12 16:20:17 tags: --- Centos7编译安装mysql5.7.9 mysql5.7有更好的性 ...
- Linux源码编译安装MySQL5.7
目录[-] 一.环境准备: 二.升级系统: 三.做一些准备工作(以下Linux命令均在su到root用户操作): 四.开始编译安装mysql-5.7.9: 一.环境准备: 我尝试过以下环境都是能成功的 ...
随机推荐
- [LeetCode] 339. Nested List Weight Sum_Easy tag:DFS
Given a nested list of integers, return the sum of all integers in the list weighted by their depth. ...
- js模拟栈
栈:先入后出,后入先出 链表:先入先出,后入后出 下面使用js实现栈 var Stack = (function(){ var items = new WeakMap(); //先入后出,后入先出 c ...
- ROSETTA使用技巧随笔--PyMOL实时观测ROSETTA模拟过程中的结构变化
没有梦想的人,就是一只咸鱼,像我,就有一个梦想,就是让蛋白模拟过程变成动画,动起来! 虽然MD中有很多方法可以方模拟过程像动画一样播放出来,但是我一直想在ROSETTA中也找一个这样的功能,这不,我发 ...
- _proto_ 和prototype自己的理解
对象(obj)并不具有prototype属性,只有函数(function)才有prototype属性 1.在JS里,万物皆对象. 方法(Function)是对象,方法的原型(Function.prot ...
- 胸片和CT断层图像是怎么来的?
本文作者系医科大学青年教师,关注公众号"计算机视觉life"菜单栏回复"医学" 进群交流 如何得到CT断层图像? 相信小伙伴体检的时候都拍过胸片,假如哪个不幸的 ...
- c#之枚举,结构体
1.枚举 2.结构体 例子1: using System; using System.Collections.Generic; using System.Linq; using System.Text ...
- c#中枚举类型的定义与使用
介绍枚举是一个指定的常数,其基础类型可以是除 Char 外的任何整型.如果没有显式声明基础类型,则使用 Int32.编程语言通常提供语法来声明由一组已命名的常数和它们的值组成的枚举.定义默认基数从O开 ...
- java基础 逻辑
1, 用for循环打印一个4*5的矩形 public class Test { public static void main(String[] args){ for (int i = 1; i &l ...
- <4>Cocos Creator基本概念(场景树 节点 坐标 组件 )
1.场景树 Cocos Creator是由一个一个的游戏场景组成,场景是一个树形结构,场景由 有各种层级关系的节点(下一节有具有介绍)组成: 如创建一个HelloWorld的默认项目NewProjec ...
- Java多线程-----线程安全及解决机制
1.什么是线程安全问题? 从某个线程开始访问到访问结束的整个过程,如果有一个访问对象被其他线程修改,那么对于当前线程而言就发生了线程安全问题: 如果在整个访问过程中,无一对象被其他线程修改,就是线程安 ...