System Description: CentOS 6.4 mysql:5.5
#查看磁盘并配置一块lvs磁盘方便后续db文件空间不够的问题
Fdisk-l | grep "^disk/dev/*" vgspvcreate/dev/sddvgcreate mysqldb/dev/sddlvcreate-n mysqldba-l 99.9G Mysqldblvs
#创建mysql安装目录
Mkdir/mysqldata
# Create MySQL User
Groupadd mysql-g 3000useradd-g 3000-u 3000-r-s/sbin/nologin MySQL
#设置mysql Directory
Mkdir/usr/loca/mysqlchown Mysql.mysql!$
# download MySQL binary installation file package
CD! $wget http://cdn.mysql.com//archives/mysql-5.5/mysql-5.5.32-linux2.6-x86_64.tar.gz./scripts/mysql_install_db --basedir=/usr/local/mysql/--datadir=/mysqldata/data/--user=mysql
# mysql Boot file
Cp/usr/local/mysql/support-files/mysql.server/etc/init.d/mysqldchmod +x/etc/init.d/mysqldchkconfig mysqld on
# set MY.CNF file
MV/ETC/MY.CNF{,.BAK}CP My-small.cnf/etc/my.cnfvim/etc/my.cnf[mysqld]basedir=/usr/local/mysql/datadir=/mysqldata /data/port = 3306server-id = 1log-bin=/mysqldata/bin_log/bin_log_masterbinlog_format=mixed
# Configure MySQL bin startup and Help files
Vim/etc/profile.d/mysqld.shexport path= $PATH:/usr/local/mysql/binvim/etc/man.configmanpath/usr/local/mysql/man
# Follow the MySQL installation directory/usr/local/mysql/,/mysqldata/data/have Mysql.mysql permissions
And then you start MySQL.
This article is from the "Xiong" blog, make sure to keep this source http://xiong51.blog.51cto.com/5239058/1834800
MySQL Binary package quick Install