Home > Database > Mysql Tutorial > body text

Linux源码安装MySQL 5.6.12 (Cmake编译)

WBOY
Release: 2016-06-07 17:30:44
Original
1114 people have browsed it

Linux源码安装MySQL 5.6.12 (Cmake编译)

1.安装make编译器(默认系统自带)

下载地址:

tar zxvf make-3.82.tar.gz
cd make-3.82
./configure
make
make install

2.安装bison

下载地址:

tar zxvf bison-2.5.tar.gz
cd bison-2.5
./configure
make
make install

3.安装gcc-c++

下载地址:

tar zxvf gcc-c++-4.4.4.tar.gz
cd gcc-c++-4.4.4
./configure
make
make install

4.安装cmake

下载地址:

tar zxvf cmake-2.8.4.tar.gz
cd cmake-2.8.4
./configure
make
make install

5.安装ncurses

下载地址:

tar zxvf ncurses-5.8.tar.gz
cd ncurses-5.8
./configure
make
make install

开始安装MySQL,,下载地址:

准备工作

groupadd mysql
useradd -r -g mysql mysql

解压并安装MySQL

tar zxvf mysql-5.5.13.tar.gz
cd mysql-5.5.13
cmake . /
-DCMAKE_INSTALL_PREFIX=/usr/local/mysql /
-DINSTALL_DATADIR=/usr/local/mysql/data
make
make install

完成后,继续下面的操作

cd /usr/local/mysql
chown -R mysql .
chgrp -R mysql .
scripts/mysql_install_db --user=mysql
chown -R root .

下面的命令是可选的,将mysql的配置文件拷贝到/etc

cp support-files/my-medium.cnf /etc/my.cnf 

启动mysql:

bin/mysqld_safe --user=mysql &
#启动mysql,看是否成功
netstat -tnl|grep 3306

上面是一种启动mysql的方法,还有一种简单的方便,如下:

#将mysql的启动服务添加到系统服务中
cp support-files/mysql.server /etc/init.d/mysql.server
#现在可以使用下面的命令启动mysql
service mysql.server start
#停止mysql服务
service mysql.server stop
#重启mysql服务
service mysql.server restart

将mysql服务添加到开机启动项,让mysql服务开机启动

chkconfig --add mysql.server

重启机器后,mysql服务就会自动启动了。

相关阅读:

基于Cmake编译安装MySQL 5.5 

使用Cmake方式安装mysql-5.5.10 

CentOS下 MySQL 5.5.13 Cmake 安装笔记 

linux

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!