Migrate mysql Partition _ MySQL

Source: Internet
Author: User
Migrate the mysql partition bitsCN.com

Today, I found that I forgot to install the largest partition in the data directory of the master-slave mysql server load balancer and directly mounted it to the root partition. I have used root partition 95% below df, as long as the migration is complete.

Note:

A. It is an ec2 host. when provided by the partner, the maximum partition is mounted to/mnt, which is defined by ourselves.

Df-h Filesystem Size Used Avail Use % Mounted on/dev/sda1 9.9G 8.9G 529 M 95% // dev/sdb 827G 201 M 785G 1%/mnt B. the database directories are all under/data.

Procedure:

1. stop the database first

/Usr/local/bin/mysqladmin-S/tmp/mysql. sock shutdown/usr/local/bin/mysqladmin-S/tmp/mysql2.sock shutdown 2. move the mysql directory under/data to/mnt

Mv mysql/mnt 3. uninstall/mnt

# The parameter can be omitted because umount/mnt is defined in/etc/fstab. 4. edit the/etc/fstab file.

Vi/etc/fstab/dev/sdb/mnt ext3 defaults 0 0 # Change to/dev/sdb/data ext3 defaults 0 0 0 5. remount/data partition

Mount/data or mount/dev/sdb 6. restart the database and check the status.

Show slave status

This article is from the "linuxjcq" blog

BitsCN.com

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.