mysql數(shù)據(jù)庫(kù)備份設(shè)置延時(shí)備份方法(mysql主從配置)
一 為什么需要延時(shí)備份
percona-xtrabackup是一個(gè)優(yōu)秀的用于增量備份的工具。今天我們講到的延時(shí)備份也是使用他們的產(chǎn)品。
以前在MySQL AB復(fù)制一文中提到了AB復(fù)制。我們首先回顧下MySQL復(fù)制的相關(guān)要點(diǎn)。AB復(fù)制又稱主從復(fù)制,實(shí)現(xiàn)的是數(shù)據(jù)同步。經(jīng)過以下步驟:
1)主服務(wù)器把數(shù)據(jù)更改記錄到二進(jìn)制日志中,這個(gè)操作叫做二進(jìn)制日志事件;
2)從服務(wù)器把主服務(wù)器的二進(jìn)制日志事件拷貝到自己的中繼日志(relay log)中;
3)從服務(wù)器執(zhí)行中繼日志中的事件,把更改應(yīng)用到自己的數(shù)據(jù)上。
在生產(chǎn)中,我們?cè)谑褂?mysql AB 復(fù)制技術(shù)不但可以起到數(shù)據(jù)庫(kù)層面負(fù)載均衡的能力,還可以起到備份數(shù)據(jù)的功能,但有的時(shí)候我們可能由于不小心誤操作導(dǎo)致數(shù)據(jù)被刪除,這這個(gè)時(shí)候 slave服務(wù)器上的數(shù)據(jù)也會(huì)同時(shí)被刪除,如果我們能夠能是的其中的一臺(tái) slave 延時(shí)備份的話, 這樣就可以從 slave服務(wù)器上找回被誤刪的數(shù)據(jù)了。
從服務(wù)器到主服務(wù)器中拷貝二進(jìn)制日志文件,如果在并發(fā)量高,網(wǎng)絡(luò)延時(shí)嚴(yán)重的情況下,會(huì)對(duì)主服務(wù)器造成相當(dāng)大的壓力,負(fù)載高,必定會(huì)出現(xiàn)很多問題,比如訪問延遲,IO瓶頸,網(wǎng)絡(luò)擁塞等等。服務(wù)器壓力過大是我們都不愿看到的情況,那有沒有方案緩解這種情況呢?有,這就是本文講到的延時(shí)備份。延時(shí)備份通過第三方工具,將檢查同步和真正同步的時(shí)間控制在一定的范圍內(nèi),而不是主服務(wù)器數(shù)據(jù)發(fā)生變化,從服務(wù)器立即去同步二進(jìn)制事件到自己的中繼日志中,這樣的話可以大大減輕主服務(wù)器的壓力,并且基于AB復(fù)制的優(yōu)點(diǎn),可以達(dá)到備份數(shù)據(jù)的目的。
環(huán)境簡(jiǎn)介
serv01:主服務(wù)器 192.168.1.11serv01.host.com
serv08:及時(shí)同步服務(wù)器 192.168.1.18serv01.host.com
serv09:延時(shí)同步服務(wù)器 192.168.1.19serv08.host.com
操作系統(tǒng)版本
RHEL Server6.1 64位系統(tǒng)
使用到的軟件包版本
mysql-5.5.29-linux2.6-x86_64.tar.gz
percona-toolkit-2.1.7-1.noarch.rpm
第一步,搭建環(huán)境。修改配置文件,注意每臺(tái)的server-id不一致;
[root@serv01 ~]# cat /etc/my.cnf | grep server-id
server-id = 1
#server-id = 2
[root@serv01 ~]# /etc/init.d/mysqld start
Starting MySQL SUCCESS!
[root@serv08 ~]# cat /etc/my.cnf | grep server-id
server-id = 2
#server-id = 2
[root@serv08 ~]# /etc/init.d/mysqld start
Starting MySQL SUCCESS!
[root@serv09 ~]# cat /etc/my.cnf | grep server-id
server-id = 3
#server-id = 2
[root@serv09 ~]# /etc/init.d/mysqld start
Starting MySQL SUCCESS!
第二步,serv01serv08 serv09清空日志
serv01
mysql> show binary logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.000001 | 683 |
+------------------+-----------+
1 row in set (0.01 sec)
mysql> reset master;
Query OK, 0 rows affected (0.01 sec)
mysql> show binary logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.000001 | 107 |
+------------------+-----------+
1 row in set (0.00 sec)
serv08
mysql> reset master;
Query OK, 0 rows affected (0.02 sec)
mysql> show binary logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.000001 | 107 |
+------------------+-----------+
1 row in set (0.00 sec)
serv09
mysql> show binary logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.000001 | 107 |
+------------------+-----------+
1 row in set (0.00 sec)
mysql> reset master;
Query OK, 0 rows affected (0.00 sec)
mysql> show binary logs;
+------------------+-----------+
| Log_name | File_size |
+------------------+-----------+
| mysql-bin.000001 | 107 |
+------------------+-----------+
1 row in set (0.00 sec)
第三步,主服務(wù)器serv01創(chuàng)建授權(quán)用戶
mysql> grant replication client, replication slave on *.* to 'larry'@'192.168.1.%' identified by 'larry';
第四步,serv08修改master設(shè)置,開啟slave,查看slave狀態(tài)
mysql> change master to
-> master_host='192.168.1.11',
-> master_user='larry',
-> master_password='larry',
-> master_port=3306,
-> master_log_file='mysql-bin.000001',
-> master_log_pos=107;
Query OK, 0 rows affected (0.03 sec)
mysql> start slave;
Query OK, 0 rows affected (0.00 sec)
mysql> show slave status G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.1.11
Master_User: larry
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 107
Relay_Log_File: serv08-relay-bin.000002
Relay_Log_Pos: 253
Relay_Master_Log_File: mysql-bin.000001
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 107
Relay_Log_Space: 410
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
1 row in set (0.00 sec)
ERROR:
No query specified
第五步,serv09延時(shí)服務(wù)器修改master狀態(tài),開啟slave,查看slave狀態(tài)
mysql> change master to master_host='192.168.1.11', master_user='larry', master_password='larry', master_port=3306, master_log_file='mysql-bin.000001', master_log_pos=107;
Query OK, 0 rows affected (0.02 sec)
mysql> start slave;
Query OK, 0 rows affected (0.01 sec)
mysql> show slave status G;
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.1.11
Master_User: larry
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 107
Relay_Log_File: serv09-relay-bin.000002
Relay_Log_Pos: 253
Relay_Master_Log_File: mysql-bin.000001
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 107
Relay_Log_Space: 410
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: 0
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
1 row in set (0.00 sec)
ERROR:
No query specified
第六步,在沒有使用延時(shí)服務(wù)器時(shí),serv01創(chuàng)建測(cè)試數(shù)據(jù)庫(kù),可以看到同步服務(wù)器serv08和延時(shí)服務(wù)器serv09已經(jīng)同步了
serv01
mysql> create database justdb;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| crm |
| justdb |
| larry |
| larrydb |
| mysql |
| performance_schema |
| test |
+--------------------+
8 rows in set (0.00 sec)
serv08
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| justdb |
| larrydb |
| mysql |
| performance_schema |
| test |
+--------------------+
6 rows in set (0.03 sec)
serv09
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| justdb |
| larry |
| larrydb |
| mysql |
| performance_schema |
| test |
+--------------------+
7 rows in set (0.00 sec)
第七步,拷貝percona-toolkit-2.1.7-1.noarch.rpm
[root@larrywen ule-mysql]# scp percona-toolkit-2.1.7-1.noarch.rpm 192.168.1.11:/opt
root@192.168.1.11's password:
percona-toolkit-2.1.7-1.noarch.rpm 100% 1767KB 1.7MB/s 00:00
第八步,主服務(wù)器中通過yum安裝percona-toolkit-2.1.7-1.noarch.rpm
[root@serv01 opt]# yum install percona-toolkit-2.1.7-1.noarch.rpm -y
第九步,使用pt-slave-delay工具進(jìn)行延時(shí)設(shè)置。可以先查看幫助。
[root@serv01 opt]# pt-slave-delay --help
pt-slave-delay starts and stops a slave server as needed to make it lag behind
the master. The SLAVE-HOST and MASTER-HOST use DSN syntax, and values are
copied from the SLAVE-HOST to the MASTER-HOST if omitted. For more details,
please use the --help option, or try 'perldoc /usr/bin/pt-slave-delay' for
complete documentation.
Usage: pt-slave-delay [OPTION...] SLAVE-HOST [MASTER-HOST]
Options:
--ask-pass Prompt for a password when connecting to MySQL
--charset=s -A Default character set
--config=A Read this comma-separated list of config files; if
specified, this must be the first option on the command
line
--[no]continue Continue replication normally on exit (default yes)
--daemonize Fork to the background and detach from the shell
--database=s -D The database to use for the connection
--defaults-file=s -F Only read mysql options from the given file
--delay=m How far the slave should lag its master (default 1h).
Optional suffix s=seconds, m=minutes, h=hours, d=days;
if no suffix, s is used.
--help Show help and exit
--host=s -h Connect to host
--interval=m How frequently pt-slave-delay should check whether the
slave needs to be started or stopped (default 1m).
Optional suffix s=seconds, m=minutes, h=hours, d=days;
if no suffix, s is used.
--log=s Print all output to this file when daemonized
--password=s -p Password to use when connecting
--pid=s Create the given PID file when daemonized
--port=i -P Port number to use for connection
--quiet -q Don't print informational messages about operation
--run-time=m How long pt-slave-delay should run before exiting.
Optional suffix s=seconds, m=minutes, h=hours, d=days;
if no suffix, s is used.
--set-vars=s Set these MySQL variables (default wait_timeout=10000)
--socket=s -S Socket file to use for connection
--use-master Get binlog positions from master, not slave
--user=s -u User for login if not current user
--version Show version and exit
--version-check=s Send program versions to Percona and print suggested
upgrades and problems (default off)
Option types: s=string, i=integer, f=float, h/H/a/A=comma-separated list, d=DSN, z=size, m=time
Rules:
This tool accepts additional command-line arguments. Refer to the SYNOPSIS and usage information for details.
DSN syntax is key=value[,key=value...] Allowable DSN keys:
KEY COPY MEANING
=== ==== =============================================
A yes Default character set
D yes Default database
F yes Only read default options from the given file
P yes Port number to use for connection
S yes Socket file to use for connection
h yes Connect to host
p yes Password to use when connecting
u yes User for login if not current user
If the DSN is a bareword, the word is treated as the 'h' key.
Options and values after processing arguments:
--ask-pass FALSE
--charset (No value)
--config /etc/percona-toolkit/percona-toolkit.conf,/etc/percona-toolkit/pt-slave-delay.conf,/root/.percona-toolkit.conf,/root/.pt-slave-delay.conf
--continue TRUE
--daemonize FALSE
--database (No value)
--defaults-file (No value)
--delay 3600
--help TRUE
--host (No value)
--interval 60
--log (No value)
--password (No value)
--pid (No value)
--port (No value)
--quiet FALSE
--run-time (No value)
--set-vars wait_timeout=10000
--socket (No value)
--use-master FALSE
--user (No value)
--version FALSE
--version-check off
第十步,serv09延時(shí)服務(wù)器中創(chuàng)建授權(quán)用戶
mysql> grant all on *.* to 'rep'@'192.168.1.%' identified by 'larry';
Query OK, 0 rows affected (0.00 sec)
第十一步,實(shí)現(xiàn)功能。
[root@serv01 ~]# pt-slave-delay --user='rep' --password='larry' --delay=3m --interval=20s --run-time=30m 192.168.1.19
2013-10-06T19:43:30 slave running 0 seconds behind
2013-10-06T19:43:30 STOP SLAVE until 2013-10-06T19:46:30 at master position mysql-bin.000001/199
<strong>命令解釋</strong>
--user='rep':延時(shí)服務(wù)器中授權(quán)用戶的用戶名,這里設(shè)置為rep
--password='larry':延時(shí)服務(wù)器中授權(quán)用戶的密碼,這里設(shè)置為larry
--delay=3m:延時(shí)同步的時(shí)間,這里設(shè)置為3分鐘
--interval=20s:檢查同步的時(shí)間,這里設(shè)置為20s
--run-time=30m:pt-slave-delay的運(yùn)行時(shí)間,這里設(shè)置為30分鐘
192.168.1.19:延時(shí)服務(wù)器的IP地址
第十二步,測(cè)試,主服務(wù)器serv01創(chuàng)建測(cè)試數(shù)據(jù)庫(kù),可以發(fā)現(xiàn)同步服務(wù)器立馬更新,而延時(shí)同步服務(wù)器要等3分鐘之后才更新
serv01
mysql> use justdb;
Database changed
mysql> create table test(id int);
Query OK, 0 rows affected (0.01 sec)
mysql> insert into test values(1);
Query OK, 1 row affected (0.00 sec)
serv08
mysql> select * from justdb.test;
+------+
| id |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
serv09
mysql> select * from justdb.test;
ERROR 1146 (42S02): Table 'justdb.test' doesn't exist
三分鐘過后查看延時(shí)服務(wù)器已經(jīng)同步成功
[root@serv01 ~]# pt-slave-delay --user='rep' --password='larry' --delay=3m --interval=20s --run-time=30m 192.168.1.19
2013-10-06T19:43:30 slave running 0 seconds behind
2013-10-06T19:43:30 STOP SLAVE until 2013-10-06T19:46:30 at master position mysql-bin.000001/199
2013-10-06T19:43:50 slave stopped at master position mysql-bin.000001/199
2013-10-06T19:44:10 slave stopped at master position mysql-bin.000001/199
2013-10-06T19:44:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:44:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:45:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:45:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:45:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:46:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:46:30 no new binlog events
2013-10-06T19:46:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:47:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:47:30 START SLAVE until master 2013-10-06T19:44:30 mysql-bin.000001/492
2013-10-06T19:47:50 slave running 0 seconds behind
2013-10-06T19:47:50 STOP SLAVE until 2013-10-06T19:50:50 at master position mysql-bin.000001/492
2013-10-06T19:48:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:48:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:48:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:49:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:49:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:49:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:50:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:50:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:50:50 no new binlog events
2013-10-06T19:51:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:51:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:51:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:52:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:52:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:52:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:53:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:53:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:53:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:54:10 no new binlog events
2013-10-06T19:54:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:54:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:55:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:55:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:55:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:56:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:56:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:56:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:57:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:57:30 no new binlog events
2013-10-06T19:57:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:58:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:58:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:58:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:59:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:59:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T19:59:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:00:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:00:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:00:50 no new binlog events
2013-10-06T20:01:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:01:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:01:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:02:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:02:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:02:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:03:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:03:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:03:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:04:10 no new binlog events
2013-10-06T20:04:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:04:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:05:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:05:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:05:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:06:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:06:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:06:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:07:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:07:30 no new binlog events
2013-10-06T20:07:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:08:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:08:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:08:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:09:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:09:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:09:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:10:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:10:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:10:50 no new binlog events
2013-10-06T20:11:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:11:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:11:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:12:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:12:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:12:50 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:13:10 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:13:30 slave stopped at master position mysql-bin.000001/492
2013-10-06T20:13:30 Setting slave to run normally
mysql> select * from justdb.test;
+------+
| id |
+------+
| 1 |
+------+
1 row in set (0.00 sec)
四 附延時(shí)備份腳本
#!/bin/bash
#
# chkconfig: - 88 12
# description: the mysql ab delay scripts
host=192.168.100.54
user=rep
password=larry
delay=2m
in=15s
prog=/usr/bin/pt-slave-delay
. /etc/init.d/functions
start() {
echo -n "Starting `basename $prog`..."
daemon $prog --host=$host --user=$user --password=$password --delay=$delay --interval=$in --daemonize --log=/var/log/mysql-delay.log
echo
}
stop() {
echo -n "Stopping `basename $prog`..."
killproc $prog
echo
}
case "$1" in
start)
start
stop)
stop
restart)
stop
start
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
- Mysql主從同步備份策略分享
- linux系統(tǒng)下實(shí)現(xiàn)mysql熱備份詳細(xì)步驟(mysql主從復(fù)制)
- 關(guān)于mysql主備切換canal出現(xiàn)的問題解決
- MySQL是如何實(shí)現(xiàn)主備同步
- CentOS7開啟MySQL8主從備份、每日定時(shí)全量備份(推薦)
- Windows服務(wù)器下MySql數(shù)據(jù)庫(kù)單向主從備份詳細(xì)實(shí)現(xiàn)步驟分享
- MYSQL 完全備份、主從復(fù)制、級(jí)聯(lián)復(fù)制、半同步小結(jié)
- Mysql多主一從數(shù)據(jù)備份的方法教程
- MySQL主備操作以及原理詳解
相關(guān)文章
Oracle10個(gè)分區(qū)和Mysql分區(qū)區(qū)別詳解
MySQL分區(qū)常用的是:range、list、hash、key,Oracle10g分區(qū)常用的是:range(范圍分區(qū))、list(列表分區(qū))、hash(哈希分區(qū))、range-hash(范圍—哈希分區(qū))、range-list(列表—復(fù)合分區(qū))。下面通過本文詳細(xì)給大家介紹Oracle10個(gè)分區(qū)和Mysql分區(qū)區(qū)別,一起看看2017-02-02mysql數(shù)據(jù)庫(kù)mysql: [ERROR] unknown option ''--skip-grant-tables'
這篇文章主要介紹了mysql數(shù)據(jù)庫(kù)mysql: [ERROR] unknown option '--skip-grant-tables',需要的朋友可以參考下2020-03-03mysql8.0?lower_case_table_names?大小寫敏感設(shè)置問題解決
在默認(rèn)情況下,這個(gè)變量是設(shè)置為0的,以保持向前兼容性,如果將該變量設(shè)置為1,則表名和數(shù)據(jù)庫(kù)名將被區(qū)分大小寫,本文主要介紹了mysql8.0?lower_case_table_names?大小寫敏感設(shè)置問題解決,感興趣的可以了解一下2023-09-09Mysql 乘法除法精度不一致問題(除法后四位小數(shù))
這篇文章主要介紹了Mysql 乘法除法精度不一致,除法后四位小數(shù),本文通過問題分析實(shí)例代碼講解,給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2020-03-03詳解mysql索引總結(jié)----mysql索引類型以及創(chuàng)建
索引是一種特殊的文件(InnoDB數(shù)據(jù)表上的索引是表空間的一個(gè)組成部分),它們包含著對(duì)數(shù)據(jù)表里所有記錄的引用指針。這篇文章主要介紹了詳解mysql索引總結(jié)----mysql索引類型以及創(chuàng)建,有興趣的可以了解一下。2016-11-11解決Linux下Tomcat向MySQL插入數(shù)據(jù)中文亂碼問題
本文給大家介紹的是如何解決win平臺(tái)下開發(fā)的項(xiàng)目移植到Linux平臺(tái)后,向MySQL插入數(shù)據(jù)時(shí)中文出現(xiàn)亂碼的問題,非常的簡(jiǎn)單實(shí)用,有需要的小伙伴可以參考下2018-04-04mysql5.7.19 winx64安裝配置方法圖文教程(win10)
這篇文章主要為大家詳細(xì)介紹了mysql5.7.19 winx64安裝配置教程,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2017-07-07