mysql在线全备份和恢复

页面导航:首页 > 数据库 > Mysql > mysql在线全备份和恢复

mysql在线全备份和恢复

来源: 作者: 时间:2016-02-05 10:57 【

mysql在线全备份和恢复在线全备份: mysqldump -uroot -p --default-character-set=utf8 --opt --master-data=1 --single-transaction --flush-logs databasename dabase_bak.sql恢复: 1)# ...
mysql在线全备份和恢复
 
在线全备份:
 
  mysqldump -uroot -p --default-character-set=utf8 --opt --master-data=1 --single-transaction --flush-logs databasename > dabase_bak.sql

 

 
恢复:
 
  1)# mysql -uroot -p databasename < dabase_bak.sql

  2)mysql>source /root/dabase_bak.sql

 

 
大的备份恢复:
 
 [[email protected]_backup ~]# vim /etc/my.cnf



[d]

datadir=/var/lib/mysql

socket=/var/lib/mysql/mysql.sock

user=mysql

# Default to using old password format for compatibility with mysql 3.x

# clients (those using the mysqlclient10 compatibility package).

old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;

# to do so, uncomment this line:

# symbolic-links=0

log-bin=mysql-bin

max_allowed_packet = 32M

query_cache_size = 32M

key_buffer_size = 384M

table_cache = 128K

[mysqld_safe]

log-error=/var/log/mysqld.log

pid-file=/var/run/mysqld/mysqld.pid

[mysqldump]

max_allowed_packet = 32M

 

 
Tags:

文章评论

最 近 更 新
热 点 排 行
Js与CSS工具
代码转换工具

<