#linux不记录痕迹
unset HISTORY HISTFILE HISTSAVE HISTZONE HISTORY HISTLOG
export HISTFILE=/dev/null
export HISTSIZE=0
export HISTFILESIZE=0
#第一种
#数据库迁移位置 因为默认得数据库放在/var/lib/mysql是在根下面 lvm默认home是最大硬盘故迁移到home下面
/etc/init.d/mysql stop
rsync -avSH /var/lib/mysql /home/
echo '[client]
port=3306
default-character-set=utf8
socket=/home/mysql/mysql.sock
[mysqld]
datadir=/home/mysql
socket=/home/mysql/mysql.sock
user=mysql
symbolic-links=0
default-character-set=utf8
max_connections=160
interactive_timeout=310000
wait_timeout=31000
query_cache_size=48M
table_cache=320
tmp_table_size=52M
thread_cache_size=8
sort_buffer_size=256K
innodb_thread_concurrency=8
myisam-recover=FORCE
max_allowed_packet=32M
innodb_file_per_table=1
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid' > /etc/my.cnf


#第二种备份方案
#备份mysql
/usr/bin/mysqldump -uroot -pxiaofan@1 vos3000  --skip-lock-tables > ./vos3000.sql

mysql
drop database vos3000;
create database vos3000;
use vos3000.sql;
source vos3000.sql;