天天看点

MySQL 安装初步

一、软件准备

OS: rhel 6.4 X64

MySQL: 5.6.24

ftp://mirror.switch.ch/mirror/mysql/Downloads/MySQL-5.6/

Cmake: 3.2.2

http://www.cmake.org/download/

安装cmake

$ ./bootstrap && make && make install

二、安装MySQL

# Preconfiguration setup

# groupadd mysql

# useradd -r -g mysql mysql

# mkdir -p /opt/mysql/data

# Beginning of source-build specific instructions

# tar zxvf mysql-5.6.24.tar.gz

# cd mysql-5.6.24

# cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql

# make

# make install

# End of source-build specific instructions

# Postinstallation setup

# cd /opt/mysql

# chown -R mysql .

# chgrp -R mysql .

# scripts/mysql_install_db --user=mysql \

         --basedir=/opt/mysql \

         --datadir=/opt/mysql/data

# chown -R root .

# chown -R mysql data

# cp support-files/mysql.server /etc/init.d/mysqld

# chmod 755 /etc/init.d/mysqld

   mysql_install_db creates a default option file named my.cnf

   in the base installation directory. This file is created from

   a template included in the distribution package named

   my-default.cnf. For more information, see Section 5.1.2.2,

   "Using a Sample Default Server Configuration File."

   A more detailed version of the source-build specific

   instructions is shown following.

   Note

   The procedure shown here does not set up any passwords for

   MySQL accounts. After following the procedure, proceed to

   Section 2.10, "Postinstallation Setup and Testing," for

   postinstallation setup and testing.

启动数据库

# /etc/init.d/mysql start

本文转自 pgmia 51CTO博客,原文链接:http://blog.51cto.com/heyiyi/1638250