Install MySQL 5.5.15 in CentOS 6.0

Source: Internet
Author: User

Install MySQL 5.5.15 in CentOS 6.0

#! /Bin/bash
# Mysql dependency
Yum-y install gcc make gcc-c ++ ncurses-devel openssl-devel
 
Wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.15.tar.gz/from/http://mysql.he.net/
Wget http://www.cmake.org/files/v2.8/cmake-2.8.5.tar.gz
Wget http://ftp.gnu.org/gnu/bison/bison-2.5.tar.gz
Tar zxvf cmake-2.8.5.tar.gz
Cd cmake-2.8.5
./Bootstrap
Gmake
Gmake install
Cd ../
 
 
Tar zxvf bison-2.5.tar.gz
Cd bison-2.5
./Configure
Make
Make install
Cd ../
 
 
Groupadd mysql
Useradd-g mysql
Tar zxvf mysql-5.5.15.tar.gz
Cd mysql-5.5.15
 
Cmake .\
-DCMAKE_INSTALL_PREFIX =/usr/local/mysql \
-DMYSQL_DATADIR =/var/mysql/data \
-DMYSQL_TCP_PORT = 3306 \
-DMYSQL_UNIX_ADDR =/usr/local/mysql. sock \
-DDEFAULT_CHARSET = utf8 \
-DDEFAULT_COLLATION = utf8_general_ci \
-DWITH_MYISAM_STORAGE_ENGINE = 1 \
-DWITH_INNOBASE_STORAGE_ENGINE = 1
 
Make & make install
Mv/etc/my. cnf/etc/my. cnf-'date + % F'
Mkdir-p/usr/local/mysql/etc
Cp support-files/my-medium.cnf/usr/local/mysql/etc/my. cnf
Mkdir-p/data/mysql/
Cd/usr/local/mysql/
Chmod 755 scripts/mysql_install_db
Chown mysql. mysql-R/usr/local/mysql/
Chown mysql. mysql-R/data/mysql/
./Scripts/mysql_install_db -- user = mysql -- basedir =/usr/local/mysql -- datadir =/data/mysql/
 
Cp support-files/mysql. server/etc/init. d/mysqld
Chmod 755/etc/init. d/mysqld
Chkconfig mysqld on
Chkconfig -- list mysqld
 
Echo pathmunge/usr/local/mysql/bin after>/etc/profile. d/mysql. sh
/Etc/profile
 
/Etc/init. d/mysqld start
Service mysqld restart

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.