mysql5.5.x in Linux CMake compile installation detailed

Source: Internet
Author: User
Tags chmod curl mysql version openssl create database

I. Installation of CMake

The code is as follows Copy Code

# if it's pure system to do the following some preparation
# Debian System
Apt-get-y Install GCC Libxml2-dev Curl screen
Libpng12-dev autoconf Libpcre3-dev make CMake bzip2
Libevent-dev Patch Libjpeg62-dev Libcurl4-openssl-dev
Libfreetype6-dev g++ libtool Libncurses5-dev psmisc Lrzsz

# Centos System
Yum-y Install GCC Libxml2-dev Curl screen
Libpng12-dev autoconf Libpcre3-dev make bzip2
Libevent-dev Patch Libjpeg62-dev Libcurl4-openssl-dev
Libfreetype6-dev g++ libtool Libncurses5-dev psmisc Lrzsz

# If CMake does not exist, it needs to be installed manually
# download files
wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz

# Compile Installation
Tar zxvf cmake-2.8.5.tar.gz
CD cmake-2.8.5
. boostarp
Make
Make install
Cmake–version

Second, install the configuration MySQL

The code is as follows Copy Code

# Download source files
wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.17.tar.gz/from/ftp://ftp.ntu.edu.tw/pub/MySQL/
# or
wget ftp://ftp.ntu.edu.tw/pub/MySQL/Downloads/MySQL-5.5/mysql-5.5.17.tar.gz

# Create users and Groups
# Build a MSYQL user and group
Groupadd MySQL
useradd-g MySQL mysql-s/usr/sbin/nologin

# Create installation directory
Mkdir-p/usr/local/webserver/mysql

# CREATE DATABASE Directory
Mkdir-p/home/mysql/3306/data

# decompression
TAR-ZXVF mysql-5.5.17.tar.gz
CD mysql-5.5.17

# Compile and install MySQL
# CMake, the parameters can not be so much, as long as a-dcmake_install_prefix=/usr/local/webserver/mysql on the line, we can configure in MY.CNF. [Mysqld] In the content, look at your copy after the my.cnf there are no these settings, there is no need to set up.
Cmake-dcmake_install_prefix=/usr/local/webserver/mysql
-dmysql_datadir=/home/mysql/3306/data
-ddefault_charset=utf8
-dwith_readline=1
-dwith_ssl=system
-dwith_embedded_server=1
-denabled_local_infile=1
-ddefault_collation=utf8_general_ci
-dwith_myisam_storage_engine=1
-dwith_innobase_storage_engine=1
-dwith_memory_storage_engine=1
-dwith_debug=0

# install MySQL
Make && make install

# If you need to change the configuration
Make clean
Rm-f CMakeCache.txt

# Copy configuration file
CP SUPPORT-FILES/MY-MEDIUM.CNF/USR/LOCAL/WEBSERVER/MYSQL/MY.CNF

# Set permissions
chmod +x/usr/local/webserver/mysql
Chown-r Mysql.mysql/usr/local/webserver/mysql

# Configure power-on Self-starter
Cp/usr/local/webserver/mysql/support-files/mysql.server/etc/init.d/mysql
chmod +x/etc/init.d/mysql
Chkconfig–list
UPDATE-RC.D mysql defaults '/sbin/chkconfig–add MySQL; /sbin/chkconfig MySQL on '
Chkconfig–list MySQL

# Modify MY.CNF Configuration
Vim/usr/local/webserver/mysql/my.cnf

# [MYSQLD] Add:
Datadir=/home/mysql/3306/data
Default-storage-engine=myisam

# The following options are available:
Log-error =/home/mysql/3306/data/error.log
Pid-file =/home/mysql/3306/data/mysql.pid
user = MySQL
Tmpdir =/tmp

# Install default datasheet
/usr/local/webserver/mysql/scripts/mysql_install_db–basedir=/usr/local/webserver/mysql–datadir=/home/mysql/ 3306/data–user=mysql

# start MySQL
/USR/LOCAL/WEBSERVER/MYSQL/BIN/MYSQLD_SAFE–DEFAULTS-FILE=/USR/LOCAL/WEBSERVER/MYSQL/MY.CNF &

# or use
# The last "&" means running in the background
/etc/init.d/mysql Start (service MySQL start)

# test whether MySQL starts

# 1 To see if there is process MySQL
Ps-ef | grep MySQL

# 2 To see if the port is running
NETSTAT-TNL | grep 3306

# 3 Read MySQL version information
/usr/local/webserver/mysql/bin/mysqladmin version

# so far, MySQL installation complete

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.