Rapid deployment of MySQL5.6.36 database practices

Source: Internet
Author: User
Tags chmod

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

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.