centos6.x install mysql5.6 and customize Data Catalog with one click

Source: Internet
Author: User

I. System environment and description

System: centos6.x_x64 MySQL: Community Edition 5.6.21, open source database with the most MySQL, compile and install more cumbersome, yum installation version is low and the default installation location is/var/, this time using the official download RPM package, Automate the installation and customization of data directories into separate partitions (this is the/DATA1 directory) through scripting


Second, prepare the installation package

1. Official Download

#https://dev.mysql.com/downloads/mysql/5.6.html#downloads Select the corresponding version and platform package:

mysql-shared-compat-5.6.x-1.el6.x86_64.rpm #x就是你下的版本号以下类同
mysql-devel-5.6.x-1.el6.x86_64.rpm
mysql-shared-5.6.x-1.el6.x86_64.rpm
mysql-client-5.6.x-1.el6.x86_64.rpm
mysql-test-5.6.x-1.el6.x86_64.rpm
mysql-server-5.6.x-1.el6.x86_64.rpm

2, the package used in this experiment

The http://pan.baidu.com/s/1nvn0nUx contains the following packages:


mysql-shared-compat-5.6.21-1.el6.x86_64.rpm
mysql-devel-5.6.21-1.el6.x86_64.rpm
mysql-shared-5.6.21-1.el6.x86_64.rpm
mysql-client-5.6.21-1.el6.x86_64.rpm
mysql-test-5.6.21-1.el6.x86_64.rpm
mysql-server-5.6.21-1.el6.x86_64.rpm


Third, installation

1, if it is the official download, please do the following operations directly

#rpm-IVH mysql-shared-compat-5.6.x-1.el6.x86_64.rpm #提供基础依赖组件 requires the first installation
#yum Remove Mysql-libs-y #御载默认自带的mysql-lib
#yum Install libaio-y #安装libiao
#rpm-IVH mysql-devel-5.6.x-1.el6.x86_64.rpm
#rpm-IVH mysql-shared-5.6.x-1.el6.x86_64.rpm
#rpm-IVH mysql-client-5.6.x-1.el6.x86_64.rpm
#rpm-IVH mysql-test-5.6.x-1.el6.x86_64.rpm
#rpm-IVH mysql-server-5.6.x-1.el6.x86_64.rpm

2, the experiment script is as follows:

#!/bin/bashsrc_dir=$ (PWD) cd  $src _dirtar xvf mysql5.6.21.x86_64.rpms.tar.gztar xvf  Mysql5.6.21.x86_64.rpms.tarcd mysql5.6.21rpm -ivh mysql-shared-compat-5.6.21-1.el6.x86_64. rpmyum remove mysql-libs -yyum install libaio -yrpm -ivh  mysql-devel-5.6.21-1.el6.x86_64.rpmrpm -ivh mysql-shared-5.6.21-1.el6.x86_64.rpmrpm -ivh  mysql-client-5.6.21-1.el6.x86_64.rpmrpm -ivh mysql-test-5.6.21-1.el6.x86_64.rpmrpm -ivh  mysql-server-5.6.21-1.el6.x86_64.rpm#service mysql start && echo  "mysql5.6.21  has installes sucess! " #mysql_root_pwd = ' gawk -f :  ' { print $4 } '  /root/.mysql_secret ' #echo   ' A  random root password has been set. you will find it in   '/root/.mysql_secret '. " #echo   "The random root password was: ' ${MYSQL_ROOT_PWd// } ' "service mysql stop[ -d /data1/mysqldb/data ] | |  mkdir -p /data1/mysqldb/data[ -d /data1/mysqldb/log ] | |  mkdir -p /data1/mysqldb/logchown mysql.mysql /data1/mysqldb -rcd /usr/bin. /mysql_install_db --user=mysql --basedir=/usr --datadir=/data1/mysqldb/data   # Migrate Data Catalog to/data1/mysqldb/data customizable cd  $src _dircp ${src_dir}/my.cnf /etccd /var/libmv  mysql /tmpservice mysql start && echo  "Mysql root password  was empty. Please change when you login mysql. "

Iv. issues of attention

1. Disable SELinux Otherwise the script installation is unsuccessful

2, after installation of the system comes with postfix and crontab tools have been Imperial, re-install Yum once can

3, the root password of the MySQL service is empty, please modify the root password yourself

or add the following line in the script to automatically modify the MySQL root password after the MySQL migration directory starts.

mysqladmin-u root Password "123.com"



This article is from the "end of the school" blog, please be sure to keep this source http://dyc2005.blog.51cto.com/270872/1942745

centos6.x install mysql5.6 and customize Data Catalog with one click

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.