MySQL Data directory Mobile

Source: Internet
Author: User

1. Be sure to close the Selinx before moving, this is very deceptive; (You must restart it after closing, this shutdown does not affect MySQL security) Vim/etc/selinux/config Open this file modification

selinux=enforcing-------To change this line to selinux=disabled, which is a security option that can't be used to access MySQL

selinuxtype=targeted-------This parameter must not be disabled, which causes the Linux system to fail to boot 2. mkdir DB----Create a data directory (you can create a logs folder under DB that is dedicated to a variety of MySQL logs) 3. Chown mysql.mysql db chown mysql.mysql db/mysql chown mysql.mysql db/mysql/* Change the permissions of the directory so that MySQL has permission to create files 3. /etc/init.d/mysql stop----Stop the MySQL service first or the move does not start normally after 3. MV/VAR/LIB/MYSQL/DB--Move the MySQL Data folder to the bottom of DB 4. VIM/ETC/MY.CNF Modify the configuration file inside the data directory and socket directory path and Binlog and Mysqld.log log path to the corresponding data directory 5. /etc/init.d/mysql inside of the data directory do not move, someone on the internet said need to change, the practice proved that no change, the judgment inside has been judged 6. /etc/init.d/mysql start database, no unexpected words will start normally

MySQL Data directory Mobile

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.