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: 一.环境准备: 我尝试过以下环境都是能成功的 ...
随机推荐
- dubbo发布和引用服务
1.首先添加相关的jar包到工程中 2.在spring(mvc)的配置文件中添加约束 xmlns:dubbo=http://code.alibabatech.com/schema/dubbo http ...
- 使用 Oracle Data Access Components连接oracel
使用微软自带的oracle连接类,在framework4.0中被标识为弃用,强行用它开发了Winform程序,发布放到XP上提示: Error System.Data.OracleClient req ...
- jQuery-导航下拉菜单-实用简单
/*CSS代碼*/ /*導航*/ .nav{background: url("../img/menu_bar.gif") repeat-x;} .nav ul li{display ...
- Python全栈-网络编程基础
一.C/S架构 1.硬件C/S架构 如PC-打印机 2.软件C/S架构 如PC-网站服务器 参照: https://baike.baidu.com/item/Client%2FServer/15044 ...
- django-pagination配置出错处理
是否有人出现这类错误: 首先确认几个修改处: setting.py添加 INSTALLED_APPS = ( # ... 'pagination', ) 添加中间件 MIDDLEWARE_CLASSE ...
- c扩展开发
为什么要用C扩展 C是静态编译的,执行效率比PHP代码高很多.同样的运算代码,使用C来开发,性能会比PHP要提升数百倍.IO操作如CURL,因为耗时主要在IOWait上,C扩展没有明显优势. 另外C扩 ...
- Abandoned country(最小生成树+树形DP)
#include<bits/stdc++.h> using namespace std; struct node{ int u, v, w, nex; bool gone; node(){ ...
- 字符编码几个缩写 ACR CCS CEF CES TES
摘自https://zhuanlan.zhihu.com/p/27012967 5. 在Unicode Technical Report (UTR统一码技术报告) #17<UNICODE CHA ...
- Java并发编程:volatile关键字解析-转
Java并发编程:volatile关键字解析 转自海子:https://www.cnblogs.com/dayanjing/p/9954562.html volatile这个关键字可能很多朋友都听说过 ...
- numpy元素级数组函数
一元函数 abs, fabs 计算整数.浮点数或复数的绝对值.对于非复数值,可以使用更快的fabs. sqrt 计算各元素的平方根.相当于arr ** 0.5 sqare 计算各元素的平方.相当于ar ...