易截截图软件、单文件、免安装、纯绿色、仅160KB

MySQL备份的几种方式的讨论,重点关注在线热备

MySQL的备份方式,目前我想到的有五种,有可能还有
1,mysqldump方式,加上具体参数名(单库,多库,触发器,存储过程,表结构,字符集,–single-transaction,等等)
2,mysqlhotcopy 只能备份myisam数据表备份,速度相当快,因为是文件拷贝,可能瞬间被锁表,任何的数据操作,比如插入和更新都会挂起。
3,LVM的快照功能进行数据库分区的备份,这种方法是利用的逻辑卷的镜像功能,对整个分区进行在线备份,这种备份数据量大,而且备份性能低下,因为每次备份都是整个镜像,不能针对数据做备份。桶装备份
4,开启二进制同步日志功能,主从复制,从机器做备份功能。
5,在线的热备份,采用开源的 Xtrabackup 备份工具对innodb 数据表进行在线备份,测试阶段。
下面是备份的xtrabackup的测试例子。
[@root.localhost.nova ~]# /usr/bin/innobackupex-1.5.1 –user=root
–defaults-file=/home/mysql/my.cnf –socket=/home/mysql/mysql.sock
–database=serverinfo –slave-info –stream=tar /root/ |gzip >
/root/bak_mysql.tar.gz
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy.
All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackup
prints “innobackup completed OK!”.
innobackupex: Using mysql Ver 14.12 Distrib 5.0.83, for pc-linux-gnu (i686) using readline 5.1
innobackupex: Using mysql server version 5.0.83-community-log
innobackupex: Created backup directory /root
090823 17:37:51 innobackupex: Starting mysql with options: –unbuffered –user=root –socket=/home/mysql/mysql.sock
090823 17:37:51 innobackupex: Connected to database with mysql child process (pid=28803)
090823 17:37:55 innobackupex: Connection to database server closed
090823 17:37:55 innobackupex: Starting ibbackup with command:
xtrabackup –defaults-file=/home/mysql/my.cnf –backup –suspend-at-end
–log-stream –target-dir=./
innobackupex: Waiting for ibbackup (pi


相关文档:

MySQL转义

MySQL识别下列转义字符:    
   
  \0    
  一个ASCII   0   (NUL)字符。    
  \n    
  一个新行符。    
  \t   &nb ......

mysql alter 语句用法,添加、修改、删除字段等

mysql alter 语句用法,添加、修改、删除字段等
//主键549830479
alter table tabelname add new_field_id int(5) unsigned default 0 not null auto_increment ,add primary key (new_field_id);
//增加一个新列549830479
alter table t2 add d timestamp;
alter table infos add ex tinyint not null default ......

MySQL 导入导出命令

      最近别人在给我 sql 文件时简单的提了下 导入/导出 命令,在此基础上学习了下,总结到 myhere。
    规定:
用户名:db_user
帐号: db_pass
数据库: db_name
表: table_name_1, table_name_2
    说明:  一些操作需要有适当的权限。
1. ......

如何提高Mysql语句插入性能

在表中已有大量的index的情况下插入大量数据,可以采用先将索引删除,然后再插入数据,然后再重新建立索引。之所以这样会快是因为???
7.2.14 Speed of INSERT Statements
The time to insert a record is determined by the following factors, where the numbers indicate approximate proportions:
  & ......

mysql与Oracle update的区别

update :单表的更新不用说了,两者一样,主要说说多表的更新
   
       Oracle> Oracle的多表更新要求比较严格,所以有的时候不是很好写,我们可以试试Oracle的游标
               &n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号