按介质分类:html
优缺点:mysql
按状态分类:sql
按距离分类:数据库
按类型分类:缓存
(1)mysqldump服务器
mysqldump -u 用户名 -p 数据库名 数据库表 > 导出的文件名
(2)拷贝物理表生成备份
当前存储引擎下每一个表都有本身独立的数据文件时可使用这种方式。若是当前数据库是运行状态,则须要对此表加上一个只读锁,防止备份期间的修改操做。
对InnoDB存储引擎的表不太支持。session
(3)select...into outfileapp
只会生成表数据,不会生成表结构函数
(4)增量备份
将MySQL实例设置开启log-bin参数,备份增量生成的二进制日志到指定的备份地工具
(5)Xtrabackup
支持全量和增量备份
(1)物理备份
CREATE TABLE `students_myisam` ( `sid` int(11) NOT NULL, `sname` varchar(64) DEFAULT NULL, `gender` int(11) DEFAULT NULL, `dept_id` int(11) DEFAULT NULL, PRIMARY KEY (`sid`), KEY `idx_sname` (`sname`), KEY `idx_gender` (`gender`), KEY `dept_id` (`dept_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8
mysql> insert into students_myisam values(1,'a',1,1),(2,'b',2,2),(3,'c',3,3); Query OK, 3 rows affected (0.01 sec) Records: 3 Duplicates: 0 Warnings: 0 开始备份 [root@localhost course]# pwd /data1/mysql/data/course [root@localhost course]# ll students_my* -rw-r----- 1 mysql mysql 8660 Mar 5 11:11 students_myisam.frm -rw-r----- 1 mysql mysql 60 Mar 5 11:12 students_myisam.MYD -rw-r----- 1 mysql mysql 5120 Mar 5 11:12 students_myisam.MYI 把这个表相关的三个文件拷贝到另外的数据库实例对应的数据库目录下(记得须要修改文件权限) [root@codis-178 cmdb_v2]# cp /home/xiaoda/students_myisam.* ./ [root@codis-178 cmdb_v2]# chown mysql:mysql students_myisam.* mysql> select * from students_myisam; +-----+-------+--------+---------+ | sid | sname | gender | dept_id | +-----+-------+--------+---------+ | 1 | a | 1 | 1 | | 2 | b | 2 | 2 | | 3 | c | 3 | 3 | +-----+-------+--------+---------+ 3 rows in set (0.00 sec)
对于InnoDB表来讲,即便设置了innodb_file_per_table=on时,直接拷贝也不行
CREATE TABLE `students_myisam2` ( `sid` int(11) NOT NULL, `sname` varchar(64) DEFAULT NULL, `gender` int(11) DEFAULT NULL, `dept_id` int(11) DEFAULT NULL, PRIMARY KEY (`sid`), KEY `idx_sname` (`sname`), KEY `idx_gender` (`gender`), KEY `dept_id` (`dept_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8
mysql> insert into students_myisam2 values(1,'a',1,1),(2,'b',2,2),(3,'c',3,3); Query OK, 3 rows affected (0.03 sec) Records: 3 Duplicates: 0 Warnings: 0 开始备份 [root@codis-178 cmdb_v2]# cp /home/xiaoda/students_myisam2.* ./ [root@codis-178 cmdb_v2]# chown mysql:mysql students_myisam2.* mysql> select * from students_myisam2; ERROR 1146 (42S02): Table 'cmdb_v2.students_myisam2' doesn't exist 日志报错: 180305 11:23:53 [ERROR] Cannot find or open table cmdb_v2/students_myisam2 from the internal data dictionary of InnoDB though the .frm file for the table exists. Maybe you have deleted and recreated InnoDB data files but have forgotten to delete the corresponding .frm files of InnoDB tables, or you have moved .frm files to another database? or, the table contains indexes that this version of the engine doesn't support. See http://dev.mysql.com/doc/refman/5.5/en/innodb-troubleshooting.html how you can resolve the problem. 因此对于InnoDB来讲能够经过拷贝整个data目录方式来完成备份和恢复。
(2)Mysqldump
用来生成MySQL的逻辑备份文件,其文件内容就是构成数据库对象和数据内容的可重复执行的SQL语句。
mysqldump [OPTIONS] database [tables] mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...] mysqldump [OPTIONS] --all-databases [OPTIONS]
options的关键参数:
-h, --host=name 要导出的目标数据库所在主机,默认是localhost -u, --user=name 连接目标数据库的数据库用户名 -p, --password[=name] 连接目标数据库的数据库密码 -P, --port=# 连接目标数据库的端口 --add-drop-database 在使用--databases或--all-databases参数时在每一个create database命令前都加上drop database命令 --add-drop-table 在每一个create table命令前加上drop table命令 --default-character-set=name 指定默认的字符集,默认是UTF8 --replace 使用该命令插入数据而不是使用insert命令 --set-charset 将set names default_character_set命令写入到导出备份文件中,默认是开启状态 --dump-slave[=#] 表示从复制的slave从库导出备份,且其中包含了change master 通语句。value参数若是不写或=-1的状况下,则change master to语句写入dump文件中,设置为2则表示也写入dump文件中,只是会注释掉 --master-data[=#] 表示从复制的主库上导出备份。value参数与--dump-slave相同。使用该参数会自动打开lock-all-table参数,除非同时使用--single-transaction参数 -T, --tab=name 表示将备份文件以文本文件的方式生成,并指定存放文件路径,每一个表会生成两个文件,一个是.sql文件保存表结构,一个是.txt文件保存表数据信息 -A, --all-databases 导出全部数据库里的全部表 -B, --databases 导出指定的一个或多个数据库 --ignore-table=name 表明导出过程当中忽略某个指定表的导出,若是要忽略多个表则这个参数使用屡次 -d, --no-data 表明只导出表结构 -R, --routines 表明导出时也要把存储过程和函数也导出来 --triggers 表明导出时也将触发器导出来 -w, --where=name 表明导出符合条件的数据 -x, --lock-all-tables 表明在导出过程当中对每一个数据库的每一个表加上一个只读锁 --no-autocommit 表明对每一个表的数据导出内容用set autocommit=0和commit两个语句包裹 --single-transaction 表明将事务隔离级别设置为可重复读并在导出开始执行start transaction开启一个新事务,在dump执行过程当中也不会阻止任何读写操做
例子:
导出一个数据库 [root@localhost ~]# mysqldump -uroot -p -P3306 --databases course > backup.sql 导出多个数据库 [root@localhost ~]# mysqldump -uroot -p -P3306 --databases course test > course.sql [root@localhost ~]# mysqldump -uroot -p -P3306 -B course test > course.sql 导出全部数据库 [root@localhost ~]# mysqldump -uroot -p -P3306 --all-databases > all.sql 仅导出course数据库的数据,不包括表结构 [root@localhost ~]# mysqldump -uroot -p -P3306 --no-create-info course > course.sql 仅导出course数据库中的students和students_myisam两个表 [root@localhost ~]# mysqldump -uroot -p -P3306 --no-create-info course students students_myisam > students.sql 仅导出course数据库的表结构 [root@localhost ~]# mysqldump -uroot -p -P3306 --no-data course > course.sql 导出course数据库中除了teacher和score两个表的其余表结构和数据 [root@localhost ~]# mysqldump -uroot -p -P3306 --ignore-table=course.teacher --ignore-table=course.score course > course.sql 导出course数据库的表和存储过程和触发器 [root@localhost ~]# mysqldump -uroot -p -P3306 --routines --triggers course > course.sql 导出course数据库中符合条件的数据 [root@localhost ~]# mysqldump -uroot -p -P3306 --where="sid in (1,2)" course students students_myisam > course.sql 远程导出course数据库 [root@localhost ~]# mysqldump -uroot -p -P3306 -h192.168.1.178 cmdb_v2 students_myisam > students.sql 在主库备份 [root@codis-178 ~]# mysqldump -uroot -p -P3306 --master-data=2 --single-transctions course > course.sql (在备份开始之初,在全部表上加一个只读锁(flush table with read lock),当成功获取该锁并开始备份以后,此锁就会当即释放,后续dump过程不会影响其余的读写操做) 在从库备份 [root@codis-178 ~]# mysqldump -uroot -p -P3306 --dump-slave --single-transctions test > test.sql
[root@codis-178 ~]# mysqldump -uroot -p -P3306 -h192.168.1.68 course > course.sql Enter password: mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064)
这是因为mysqldump版本低致使,也就是5.5版本不能导出5.7版本
如何解决?
用5.7或更高版本的mysqldump覆盖或者指定目录运行便可?
使用mysqldump命令导出文本文件,经过指定--tab=dir_name参数来指定文件路径
添加配置 secure-file-priv=/tmp/ [root@localhost ~]# mysqldump -uroot -p -P3306 --tab=/tmp course [root@localhost ~]# ll /tmp/course.sql -rw-r--r-- 1 root root 1544 Mar 5 13:28 /tmp/course.sql
还可指定文件格式
[root@localhost ~]# mysqldump -uroot -p -P3306 --tab=/tmp course --fields-terminated-by=, --fields-enclosed-by="'" --lines-terminated-by="\n" course Enter password: [root@localhost ~]# cat /tmp/course.txt '1','math','3' '2','english','2' '3','chinese','4' '4','history','1' '5','biology','5'
(3)select... into outfile
用来导出表中符合条件的数据到文本文件,不导出表结构
mysql> select * from students_myisam into outfile '/tmp/students_myisam_test.txt' fields terminated by ',' enclosed by "'" lines teerminated by '\r\n'; Query OK, 3 rows affected (0.00 sec) [root@localhost ~]# cat /tmp/students_myisam_test.txt '1','a','1','1' '2','b','2','2' '3','c','3','3' mysql> select * from students_myisam where sid in (1,2) into outfile '/tmp/students_myisam_test2.txt' fields terminated by ',' encllosed by "'" lines terminated by '\r\n'; Query OK, 2 rows affected (0.01 sec) [root@localhost ~]# cat /tmp/students_myisam_test2.txt '1','a','1','1' '2','b','2','2'
参数说明:
(1)锁
在执行mysqldump时,会添加flush tables with read lock(FTWRL),用于备份时获取一致性备份(数据与binlog位点匹配)。
因为FTWRL总共须要持有两把全局MDL锁,而且还须要关闭全部表对象,所以这个命令杀伤力很大,执行命令时容易致使库hang住。
FTWEL主要包括三个步骤:
1.上全局读锁(lock_global_read_lock)
致使全部更新操做都会被堵塞
2.清理表缓存(close_cached_tables)
关闭表过程当中,若是有大量查询致使关闭表等待,那么全部访问该表的查询和更新都须要等待
3.上全局commit锁(make_global_read_lock_block_commit)
会堵塞活跃事务提交
第一个session mysql> flush tables with read lock; Query OK, 0 rows affected (0.15 sec) 第二个session mysql> select * from dept; +----+------------------+ | id | dept_name | +----+------------------+ | 1 | Education | | 2 | Computer Science | | 3 | Mathematics | +----+------------------+ 3 rows in set (0.00 sec) mysql> update dept set dept_name="Sport" where id=1; 此时写操做会被阻止,等待超时 第一个session mysql> unlock tables; Query OK, 0 rows affected (0.00 sec)
第一个session mysql> set autocommit=0; Query OK, 0 rows affected (0.00 sec) mysql> update dept set dept_name="Sport" where id=1; Query OK, 1 row affected (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 0 第二个session 执行备份操做,当存在--master-data参数时,导出成功 [root@localhost ~]# mysqldump -uroot -p -P3306 --master-data course > course.sql 当普通导出时,发生锁等待状况 [root@localhost ~]# mysqldump -uroot -p -P3306 course > course.sql Enter password: 在第一个session中查看 mysql> show processlist;
(2)可重复读隔离级别
第一个session mysql> set tx_isolation='repeatable-read'; Query OK, 0 rows affected, 1 warning (0.00 sec) 第二个session mysql> select * from A; +------+-------+ | sid | score | +------+-------+ | 8 | 94 | +------+-------+ 1 row in set (0.01 sec) 第一个session mysql> start transaction; Query OK, 0 rows affected (0.04 sec) 第二个session mysql> insert into A value(9,87); Query OK, 1 row affected (0.07 sec) 第一个session mysql> select * from A; +------+-------+ | sid | score | +------+-------+ | 8 | 94 | | 9 | 87 | +------+-------+ 2 rows in set (0.00 sec) 能够看到session2修改后的记录
第一个session mysql> start transaction with consistent snapshot; Query OK, 0 rows affected (0.00 sec) 第二个session mysql> insert into A value(10,76); Query OK, 1 row affected (0.08 sec) 第一个session mysql> select * from A; +------+-------+ | sid | score | +------+-------+ | 8 | 94 | | 9 | 87 | +------+-------+ 2 rows in set (0.00 sec) 不能够看到session2修改后的记录,须要提交
说明:
start transaction执行后,事务并无开始,因此insert发生在session1的事务开始以前,因此能够读到修改后的值。
start transaction with consistent snapshot已经开始了事务,因此不能读到。
(1)普通恢复
导入一个备份文件 mysql -uroot -p course < course.sql 或者 进入数据库,并切换到实例下 source course.sql
(2)恢复文本文件
数据文件导入使用mysqlimport或是load data infile mysqlimport -uroot -p --fields-terminated-by=, --fields-enclosed-by="'" --lines-terminated-by="\n" course /tmp/course.txt use course; load data infile '/tmp/course.txt' into table students fields terminated by ',' enclosed by "'" lines terminated by '\r\n';
(3)全量恢复
将备份文件中的全部数据进行恢复,恢复完成后的数据就是生成备份的那一刻的数据状态。
(4)基于时间点的恢复
将数据库恢复到指定的某个时间点的状态,一般须要依赖二进制日志将指定时间点前的全部数据库操做都从新操做一遍。
步骤:
1.经过全量备份将数据库恢复到上一个全量恢复的时间点
2.利用二进制日志恢复到指定时间点
开启二进制日志
log-bin=mysql-bin binlog_format=ROW expire_logs_days=10
测试实验:
mysql> alter table students add tstamp timestamp; Query OK, 0 rows affected (0.92 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> flush logs; Query OK, 0 rows affected (0.30 sec) mysql> insert into students(sid,sname,gender,dept_id,tstamp) values(9,'Mix',1,2,now()),(10,'Tom',0,1,now()); Query OK, 2 rows affected (0.09 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> flush logs; Query OK, 0 rows affected (0.24 sec) mysql> insert into students(sid,sname,gender,dept_id,tstamp) values(11,'Luis',-1,2,now()),(12,'Sun',0,3,now()); Query OK, 2 rows affected (0.09 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> insert into students(sid,sname,gender,dept_id,tstamp) values(13,'Martis',-1,1,now()),(14,'Oifer',1,3,now()); Query OK, 2 rows affected (0.07 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> flush logs; Query OK, 0 rows affected (0.24 sec) mysql> select * from students; +-----+--------+--------+---------+---------------------+ | sid | sname | gender | dept_id | tstamp | +-----+--------+--------+---------+---------------------+ | 1 | abc | 1 | 1 | 2018-03-05 14:46:41 | | 2 | Andy | -1 | 1 | 2018-03-05 14:46:41 | | 3 | Bob | -1 | 1 | 2018-03-05 14:46:41 | | 4 | Ruth | -1 | 2 | 2018-03-05 14:46:41 | | 5 | Mike | -1 | 2 | 2018-03-05 14:46:41 | | 6 | John | 0 | 3 | 2018-03-05 14:46:41 | | 7 | Cindy | 1 | 3 | 2018-03-05 14:46:41 | | 8 | Susan | 1 | 3 | 2018-03-05 14:46:41 | | 9 | Mix | 1 | 2 | 2018-03-05 14:50:04 | | 10 | Tom | 0 | 1 | 2018-03-05 14:50:04 | | 11 | Luis | -1 | 2 | 2018-03-05 14:51:48 | | 12 | Sun | 0 | 3 | 2018-03-05 14:51:48 | | 13 | Martis | -1 | 1 | 2018-03-05 14:52:27 | | 14 | Oifer | 1 | 3 | 2018-03-05 14:52:27 | +-----+--------+--------+---------+---------------------+ 14 rows in set (0.00 sec) mysql> truncate table students; Query OK, 0 rows affected (0.21 sec) mysql> select * from students; Empty set (0.00 sec) 首先恢复students表的全量备份 mysql> source backup.sql; mysql> select * from students; +-----+-------+--------+---------+---------------------+ | sid | sname | gender | dept_id | tstamp | +-----+-------+--------+---------+---------------------+ | 1 | abc | 1 | 1 | 2018-03-05 14:46:41 | | 2 | Andy | -1 | 1 | 2018-03-05 14:46:41 | | 3 | Bob | -1 | 1 | 2018-03-05 14:46:41 | | 4 | Ruth | -1 | 2 | 2018-03-05 14:46:41 | | 5 | Mike | -1 | 2 | 2018-03-05 14:46:41 | | 6 | John | 0 | 3 | 2018-03-05 14:46:41 | | 7 | Cindy | 1 | 3 | 2018-03-05 14:46:41 | | 8 | Susan | 1 | 3 | 2018-03-05 14:46:41 | +-----+-------+--------+---------+---------------------+ 8 rows in set (0.01 sec) 恢复某个时间点数据 [root@localhost data]# mysqlbinlog mysql-bin.000002 | mysql -uroot -p Enter password: mysql> select * from students; +-----+-------+--------+---------+---------------------+ | sid | sname | gender | dept_id | tstamp | +-----+-------+--------+---------+---------------------+ | 1 | abc | 1 | 1 | 2018-03-05 14:46:41 | | 2 | Andy | -1 | 1 | 2018-03-05 14:46:41 | | 3 | Bob | -1 | 1 | 2018-03-05 14:46:41 | | 4 | Ruth | -1 | 2 | 2018-03-05 14:46:41 | | 5 | Mike | -1 | 2 | 2018-03-05 14:46:41 | | 6 | John | 0 | 3 | 2018-03-05 14:46:41 | | 7 | Cindy | 1 | 3 | 2018-03-05 14:46:41 | | 8 | Susan | 1 | 3 | 2018-03-05 14:46:41 | | 9 | Mix | 1 | 2 | 2018-03-05 14:50:04 | | 10 | Tom | 0 | 1 | 2018-03-05 14:50:04 | +-----+-------+--------+---------+---------------------+ 10 rows in set (0.00 sec) [root@localhost data]# mysqlbinlog mysql-bin.000003 | mysql -uroot -p Enter password: mysql> select * from students; +-----+--------+--------+---------+---------------------+ | sid | sname | gender | dept_id | tstamp | +-----+--------+--------+---------+---------------------+ | 1 | abc | 1 | 1 | 2018-03-05 14:46:41 | | 2 | Andy | -1 | 1 | 2018-03-05 14:46:41 | | 3 | Bob | -1 | 1 | 2018-03-05 14:46:41 | | 4 | Ruth | -1 | 2 | 2018-03-05 14:46:41 | | 5 | Mike | -1 | 2 | 2018-03-05 14:46:41 | | 6 | John | 0 | 3 | 2018-03-05 14:46:41 | | 7 | Cindy | 1 | 3 | 2018-03-05 14:46:41 | | 8 | Susan | 1 | 3 | 2018-03-05 14:46:41 | | 9 | Mix | 1 | 2 | 2018-03-05 14:50:04 | | 10 | Tom | 0 | 1 | 2018-03-05 14:50:04 | | 11 | Luis | -1 | 2 | 2018-03-05 14:51:48 | | 12 | Sun | 0 | 3 | 2018-03-05 14:51:48 | | 13 | Martis | -1 | 1 | 2018-03-05 14:52:27 | | 14 | Oifer | 1 | 3 | 2018-03-05 14:52:27 | +-----+--------+--------+---------+---------------------+
若是恢复某个日志文件中的一部份内容,能够经过指定--start-datetime或是--stop-datetime参数来肯定开始恢复和中止的时间。
mysqlbinlog --start-datetime="2018-02-05 10:23:41" /data1/mysql/data/mysql-bin.000001 | mysql -uroot -p mysqlbinlog --stop-datetime="2018-03-05 15:00:00" /data1/mysql/data/mysql-bin.000001 | mysql -uroot -p
Xtrabackup是一个对MySQL作数据备份的工具,支持在线热备份(备份时不影响数据读写)。
特色:
[root@localhost ~]# wget https://www.percona.com/downloads/XtraBackup/Percona-XtraBackup-2.4.9/binary/tarball/percona-xtrabackup-2.4.9-Linux-x86_64.tar.gz [root@localhost ~]# tar -zxvf percona-xtrabackup-2.4.9-Linux-x86_64.tar.gz [root@localhost ~]# cp percona-xtrabackup-2.4.9-Linux-x86_64/bin/* /usr/bin/ 全量备份 [root@localhost data1]# mkdir backup [root@localhost backup]# xtrabackup --backup --target-dir=/data1/backup/ -uroot -p'MY@)!&sql2017' -P3306 --host=127.0.0.1 ... ... ... xtrabackup: Transaction log of lsn (11460068) to (11460077) was copied. 180305 15:14:34 completed OK! 恢复 [root@localhost mysql]# mv data data_bak [root@localhost mysql]# ls data_bak [root@localhost mysql]# mkdir data [root@localhost mysql]# chown -R mysql:mysql data 首先执行prepare,将全部的数据文件都准备到同一时间点,由于在备份过程当中全部数据文件都在不一样的时间点,若是直接恢复会致使冲突 [root@localhost mysql]# xtrabackup --prepare --target-dir=/data1/backup/ ... ... ... InnoDB: Shutdown completed; log sequence number 11461479 180305 15:16:48 completed OK! 全量恢复 [root@localhost mysql]# xtrabackup --copy-back --target-dir=/data1/backup/ --datadir=/data1/mysql/data ... ... ... 180305 15:20:17 [01] Copying ./test1/app01.ibd to /data1/mysql/data/test1/app01.ibd 180305 15:20:17 [01] ...done 180305 15:20:17 completed OK! [root@localhost mysql]# chown -R mysql:mysql data
增量备份 [root@localhost backup]# mkdir base [root@localhost backup]# chown -R mysql:mysql base [root@localhost backup]# xtrabackup --backup --traget-dir=/data1/backup/base -uroot -p'MY@)!&sql2017' -P3306 --host=127.0.0.1 mysql> insert into students values(15,'aa',1,1,now()); Query OK, 1 row affected (0.07 sec) mysql> insert into students values(16,'bb',1,2,now()); Query OK, 1 row affected (0.09 sec) [root@localhost ~]# xtrabackup --backup --target-dir=/data1/backup/inc1 --incremental-basedir=/data1/backup/base -uroot -p'MY@)!&sql2017' -P3306 --host=127.0.0.1 mysql> insert into students values(17,'cc',0,3,now()); Query OK, 1 row affected (0.19 sec) mysql> insert into students values(18,'dd',-1,3,now()); Query OK, 1 row affected (0.22 sec) [root@localhost ~]# mkdir -p /data1/backup/inc2 [root@localhost ~]# chown -R mysql:mysql /data1/backup/inc2 [root@localhost ~]# xtrabackup --backup --target-dir=/data1/backup/inc2 --incremental-basedir=/data1/backup/inc1 -uroot -p'MY@)!&sql2017' -P3306 --host=127.0.0.1 增量恢复 [root@localhost mysql]# xtrabackup --prepare --apply=log-only --target-dir=/data1/backup/base --datadir=/data1/mysql/data [root@localhost mysql]# xtrabackup --prepare --apply-log-only --target-dir=/data1/backup/base --incremental-datadir=/data1/backup/inc1 --datadir=/data1/mysql/data [root@localhost mysql]# xtrabackup --prepare --target-dir=/data1/backup/base --incremental-datadir=/data1/backup/inc2 --datadir=/data1/mysql/data [root@localhost mysql]# xtrabackup --copy-back --target-dir=/data1/backup/base/ --datadir=/data1/mysql/data mysql> select * from students; +-----+--------+--------+---------+---------------------+ | sid | sname | gender | dept_id | tstamp | +-----+--------+--------+---------+---------------------+ | 1 | abc | 1 | 1 | 2018-03-05 14:46:41 | | 2 | Andy | -1 | 1 | 2018-03-05 14:46:41 | | 3 | Bob | -1 | 1 | 2018-03-05 14:46:41 | | 4 | Ruth | -1 | 2 | 2018-03-05 14:46:41 | | 5 | Mike | -1 | 2 | 2018-03-05 14:46:41 | | 6 | John | 0 | 3 | 2018-03-05 14:46:41 | | 7 | Cindy | 1 | 3 | 2018-03-05 14:46:41 | | 8 | Susan | 1 | 3 | 2018-03-05 14:46:41 | | 9 | Mix | 1 | 2 | 2018-03-05 14:50:04 | | 10 | Tom | 0 | 1 | 2018-03-05 14:50:04 | | 11 | Luis | -1 | 2 | 2018-03-05 14:51:48 | | 12 | Sun | 0 | 3 | 2018-03-05 14:51:48 | | 13 | Martis | -1 | 1 | 2018-03-05 14:52:27 | | 14 | Oifer | 1 | 3 | 2018-03-05 14:52:27 | | 15 | aa | 1 | 1 | 2018-03-05 15:34:55 | | 16 | bb | 1 | 2 | 2018-03-05 15:35:55 | | 17 | cc | 0 | 3 | 2018-03-05 15:42:14 | | 18 | dd | -1 | 3 | 2018-03-05 15:42:23 | +-----+--------+--------+---------+---------------------+ 18 rows in set (0.00 sec)