MYSQL5.5源码安装 linux下
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MYSQL5.5源码安装 linux下相关的知识,希望对你有一定的参考价值。
/* 首先安装必要的库 */ yum -y install gcc* ###### 安装 mysql ###### 首先安装camke 一、支持YUM,则 yum install -y cmake 二、也可以源码安装 [[email protected] ~]# cd /usr/local/src #下载cmake [[email protected] src]# wget http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz [[email protected] src]# tar zxvf cmake-2.8.7.tar.gz [[email protected] src]# cd cmake-2.8.7 #安装cmake [[email protected] cmake-2.8.7]# ./configure [[email protected] cmake-2.8.7]# make [[email protected] cmake-2.8.7]# make install /* 安装 MYSQL 官网下载 MYSQL5.5版本 linux下源码包 http://dev.mysql.com/downloads/ */ 安装 [[email protected] ~]# groupadd mysql [[email protected] ~]# useradd -g mysql mysql [[email protected] ~]# tar zxvf mysql-5.2.25.tar.gz [[email protected] ~]# cd mysql-5.2.25 /* #cmake . //默认情况下安装,安装目录为/usr/local/mysql 数据目录为/usr/local/mysql/data #也可以指定参数安装,如指定UTF8,数据引擎等 #具体参照http://dev.mysql.com/doc/refman/ ... ration-options.html */ [[email protected] mysql-5.2.25]# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_EXTRA_CHARSETS:STRING=all -DWITH_DEBUG=0 -DWITH_SSL=yes -DWITH_READLINE=1 -DENABLED_LOCAL_INFILE=1 [[email protected] mysql-5.2.25]# make && make install [[email protected] mysql-5.2.25]# cd /usr/local/mysql [[email protected] mysql]# chown -R mysql:mysql /usr/local/mysql [[email protected] mysql]# ./scripts/mysql_install_db --user=mysql -datadir=/mysql/data #此处如不指定datadir,到启动时会报错 [[email protected] mysql]# chown -R root . [[email protected] mysql]# chown -R mysql data [[email protected] mysql]# cp support-files/my-medium.cnf /etc/my.cnf [[email protected] mysql]# bin/mysqld_safe --user=mysql & # Next command is optional [[email protected] mysql]# cp support-files/mysql.server /etc/init.d/mysqld [[email protected] mysql]# chmod +x /etc/init.d/mysqld [[email protected] mysql]# /etc/init.d/mysqld start 到此,安装完成
以上是关于MYSQL5.5源码安装 linux下的主要内容,如果未能解决你的问题,请参考以下文章
Linux下源码安装LAMP(CentOS 6.8 + Apache2.4 + MySQL5.5 + PHP7)环境
Linux下源码安装LAMP(CentOS 6.8 + Apache2.4 + MySQL5.5 + PHP7)环境