1. Create User Install dependency package upload Package
[[email protected] ~]# useradd-s/sbin/nologin-m mysql #<== create user
[[email protected] app]# Yum install libaio* perl-devel-y #<== installation Dependency Package
[[email protected] app]# mkdir-p/home/app #<== create software storage directory
[[email protected] app]# cd/home/app #<== switch directory upload file
[Email protected] app]# RZ
2. Unzip the Mobile installation package
[[Email protected] app]# tar zvxf mysql-5.6.36-linux-glibc2.5-x86_64.tar.gz #<== unpacking the installation package
[[email protected] app]# Mkdir/app #<== create software Installation directory
[[Email protected] app]# mv mysql-5.6.36-linux-glibc2.5-x86_64/app/mysql-5.6.36 #<== Mobile installation package directory to the Software installation directory
[[email protected] app]# ln-s/app/mysql-5.6.36/app/mysql #<== Creating a soft connection
3. Initialize the database
[[email protected] app]# cp/app/mysql/support-files/my-default.cnf/etc/my.cnf #<== Copy configuration file
[[email protected] app]# chown-r mysql.mysql/app/mysql #<== Change directory permissions
[[email protected] app]# chmod-r 1777/tmp/#<== Change Permissions
[Email protected] data]#/app/mysql/scripts/mysql_install_db--user=mysql--basedir=/app/mysql--datadir=/app/mysql /data #<== Initializing database
[[email protected] data]# cp/app/mysql/support-files/mysql.server/etc/init.d/mysqld #<== copy startup script to boot directory
[Email protected] data]# chmod +x/etc/init.d/mysqld #给启动脚本添加执行权限
[Email protected] data]# sed-i ' s#/usr/local/mysql#/app/mysql#g '/etc/init.d/mysqld/app/mysql/bin/mysqld_safe #< = = Replace the default installation location path
[[email protected] data]# chkconfig--add mysqld #<== Join boot entry
[[email protected] data]# chkconfig mysqld on #<== set boot up
[[email protected] data]# chkconfig--list mysqld #<== See if the settings take effect
[[email protected] data]# echo "Export Path=/app/mysql/bin:path" >>/etc/profile #<== Add environment variable
[[email protected] data]# source/etc/profile #<== Effective environment variable
[[email protected] data]#/etc/init.d/mysqld start #<== startup program
[[email protected] data]# mysql #<== login test Successful
Rapid deployment of MySQL5.6.36 database practices