mysql+mmm源码安装_Mysql源码安装

Redhat下的Mysql源码安装

Installing MySQL on Linux Using the MySQL Yum Repository

如果选择使用yum安装5.6版本

Enable to use MySQL 5.6

[mysql56-community]

name=MySQL 5.6 Community Server

baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

shell> sudo yum install mysql-community-server

源码安装

Source Installation System Requirements

CMake, which is used as the build framework on all platforms

GNU make 3.75 or higher

A working ANSI C++ compiler. GCC 4.2.1 or later

erl is needed if you intend to run test scripts

How to Get MySQL

解压后的文件目录架构如下所示:

DirectoryContents of Directory

bin, scriptsmysqld server, client and utility programs

dataLog files, databases

docsMySQL manual in Info format

manUnix manual pages

includeInclude (header) files

libLibraries

shareMiscellaneous support files, including error messages, sample configuration files, SQL for database installation

sql-benchBenchmarks

开始安装

建立用户,解压文件

shell> groupadd mysql

shell> useradd -g mysql mysql

shell> cd /usr/local

shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz

shell> ln -s full-path-to-mysql-VERSION-OS mysql

shell> cd mysql

shell> chown -R mysql .

shell> chgrp -R mysql .

自定义数据文件的保存文件

shell> mkdir -p /data/mysql

初始化mysql,basedir 是解压安装文件的目录

shell>/script/mysql_install_db --user=mysql --basedir=/usr/local/mysql/ --datadir=/data/mysql/

修改配置文件 ,并建立配置文件短链接

vi /usr/local/mysql/my.cnf

basedir = /usr/local/mysql

datadir = /data/mysql

ln -s /usr/local/mysql/my.cnf /etc/my.cnf

shell> cp support-files/mysql.server /etc/init.d/mysqld 将常用启动服务放到/etc/init文件中

增加环境变量

vi /etc/profile

export PATH=$PATH:/usr/local/mysql/bin

source /etc/profile 立即生效配置

service mysqld start 启动mysql程序

添加自动启动

chkconfig --add mysqld

chkconfig mysqld on

Mysql启动成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值