MySQL migration under CentOS5.6

Source: Internet
Author: User
Tags localhost mysql automake
For MySQL migration under CentOS5.6, copy all the files in the database under the mysql database directory under the sandata directory to datadb on 172.28.29.21.

For MySQL migration under CentOS 5.6, copy all the files in the database of mysql under the/sandata directory to/data/DB on 172.28.29.21.

This week, two sets of EMC storage are migrated, and several intranet database servers are attached to the storage space. You need to migrate the stored database to the server. The specific migration steps are as follows:

I. Environment:

1. original database server: 172.28.29.21 (Mount EMC to the/sandata directory)

2. Database Server: 10.20.220.107

II. Specific ideas:

1. Run NFS on 10.20.220.107 and mount/data/db to 172.28.29.21.

2. Mount/data/db of 10.20.220.107 to/data/db on 172.28.29.21

3. copy all files in the mysql database directory DB under the/sandata directory to/data/db on 172.28.29.21.

4. Install the mysql database on 10.20.220.107 and point the database path to/data/db.

5. Test

Iii. Implementation steps

1. The first three steps are simple. I will not talk about them here. Next we will install the mysql database.

A. Install ncurses-devel first

[Root @ localhost ~] # Yum install ncurses-devel

B. Install mysql

[Root @ localhost ~] # Useradd mysql-s/sbin/nologin

[Root @ localhost ~] # Tar-zxvf mysql-5.1.54.tar.gz
[Root @ localhost ~] # Cd mysql-5.1.54

[Root @ localhost mysql-5.1.54] #. /configure -- prefix =/usr/local/mysql -- with-mysqld-user = mysql -- with-extra-charsets = all -- with-charset = utf8 -- with-unix-socket- path =/usr/local/mysql/var/mysql. sock -- enable-thread-safe-client -- with-plugins = innobase

Note: This error may be reported in this step:

Config. status: executing libtool commands
/Bin/rm: cannot remove 'libtoolt': No such file or directory
Config. status: executing default commands
Solution:

Run the following command before executing./configure:
# Autoreconf -- force -- install
# Libtoolize -- automake -- force
# Automake -- force -- add-missing

Execute again:

[Root @ localhost mysql-5.1.54] #. /configure -- prefix =/usr/local/mysql -- with-mysqld-user = mysql -- with-extra-charsets = all -- with-charset = utf8 -- with-unix-socket- path =/usr/local/mysql/var/mysql. sock -- enable-thread-safe-client -- with-plugins = innobase

[Root @ localhost mysql-5.1.54] # make & make install

# Copy a my. cnf file to/etc, and I will post the content later

[Root @ localhost data] # chown mysql/data/db

[Root @ localhost db] # chmod 777/data/db

[Root @ localhost ~] #/Usr/local/mysql/bin/mysql_install_db -- user = mysql -- datadir =/data/db

[Root @ localhost db] #/usr/local/mysql/bin/mysqld_safe &

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.