Skip to content

Commit bc653d1

Browse files
authored
DOCSP-34352 Add MySQL Data Prerequisite page (#90)
* DOCSP-34352 Add MySQL Data Prerequisite page
1 parent 014f857 commit bc653d1

File tree

8 files changed

+230
-17
lines changed

8 files changed

+230
-17
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. step:: (Optional) Set up user permissions
2+
3+
The following code creates a new MySQL service account
4+
for Relational Migrator to connect to the MySQL
5+
instance. Alternatively, you can use an existing MySQL service
6+
account to connect to Relational Migrator with the appropriate
7+
permissions.
8+
9+
a. Create a service account:
10+
11+
.. code-block:: sql
12+
:copyable: true
13+
14+
CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
15+
16+
#. Grant the required permissions to the service account:
17+
18+
.. code-block:: sql
19+
:copyable: true
20+
21+
GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT
22+
ON *.*
23+
TO 'user'@'%';
24+
25+
#. Apply the user privilege changes:
26+
27+
.. code-block:: sql
28+
:copyable: true
29+
30+
FLUSH PRIVILEGES;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Snapshot sync jobs migrate all the data and then stops.
2+
- Continuous sync job run a snapshot and then enter a CDC stage to
3+
continuously replicate data changes.

source/prerequisites.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ database for use with Relational Migrator.
2121
/prerequisites/oracle
2222
/prerequisites/postgres
2323
/prerequisites/sql-server
24+
/prerequisites/sybase
2425

source/prerequisites/my-sql.txt

Lines changed: 171 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,180 @@
11
.. _rm-prereq-mysql:
22

3-
=============================
4-
MySQL Migration Prerequisites
5-
=============================
3+
===========================================
4+
Configure Migration Prerequisites for MySQL
5+
===========================================
66

77
.. contents:: On this page
88
:local:
99
:backlinks: none
1010
:depth: 1
1111
:class: singlecol
1212

13-
MySQL.
13+
To run sync jobs from a MySQL source database, the database may require
14+
some configuration changes. If Relational Migrator determines the
15+
database needs configuration changes, it automatically generates a
16+
SQL script with the required changes. It is recommended to have a
17+
Database Administrator (DBA) review the commands in this script and
18+
perform their execution on the database server. The
19+
MySQL Server configurations depend on the type of sync job:
20+
21+
.. include:: /includes/fact-short-sync-job-desc.rst
22+
23+
For details on supported versions of MySQL, see
24+
:ref:`supported-databases`.
25+
26+
Steps
27+
-----
28+
29+
30+
.. tabs::
31+
32+
.. tab:: Snapshot Jobs
33+
:tabid: enable-snapshot-jobs
34+
35+
.. procedure::
36+
:style: normal
37+
38+
.. include:: /includes/fact-my-sql-setup-user-permission-step.rst
39+
40+
.. tab:: Continuous Jobs
41+
:tabid: enable-continuous-jobs
42+
43+
Running continuous jobs on Relational Migrator
44+
requires the `binary log <https://dev.mysql.com/doc/refman/8.0/en/binary-log.html>`__
45+
to be enabled on your MySQL instance. The binary log (Binlog)
46+
records all operations in the order they are committed to the
47+
database.
48+
49+
.. procedure::
50+
:style: normal
51+
52+
.. include:: /includes/fact-my-sql-setup-user-permission-step.rst
53+
54+
.. step:: (Optional) Manually verify Binlog is enabled
55+
56+
Relational Migrator automatically checks this setting for
57+
you. To manually check the if the ``Binlog`` option is
58+
enabled, use the queries below for your version of MySQL:
59+
60+
.. note::
61+
62+
``Binlog`` is automatically enabled by default
63+
on MySQL ``8.x`` versions.
64+
65+
.. tabs::
66+
67+
.. tab:: MySql 8.x
68+
:tabid: mysql-8x
69+
70+
.. code-block:: sql
71+
:copyable: true
72+
73+
SELECT variable_value as "BINARY LOGGING STATUS (log-bin) ::"
74+
75+
FROM performance_schema.global_variables WHERE variable_name='log_bin';
76+
77+
.. tab:: MySql 5.x
78+
:tabid: mysql-5x
79+
80+
.. code-block:: sql
81+
:copyable: true
82+
83+
SELECT variable_value as "BINARY LOGGING STATUS (log-bin) ::"
84+
85+
FROM information_schema.global_variables WHERE variable_name='log_bin';
86+
87+
.. step:: Locate and update the MySQL configuration file
88+
89+
a. Run the following SQL query to get the ``server_id``
90+
value for your MySQL instance:
91+
92+
.. tabs::
93+
94+
.. tab:: MySql 8.x
95+
:tabid: mysql-8x
96+
97+
.. code-block:: sql
98+
:copyable: true
99+
100+
SELECT variable_value
101+
FROM
102+
performance_schema.global_variables
103+
WHERE variable_name='server_id';
104+
105+
.. tab:: MySql 5.x
106+
:tabid: mysql-5x
107+
108+
.. code-block:: sql
109+
:copyable: true
110+
111+
SELECT variable_value
112+
FROM
113+
information_schema.global_variables
114+
WHERE variable_name='server_id';
115+
116+
#. Locate the config file for your MySQL instance by running
117+
the following ``mysqld`` command in your terminal:
118+
119+
.. tabs::
120+
121+
.. tab:: Windows
122+
:tabid: windows
123+
124+
.. code-block::
125+
:copyable: true
126+
127+
mysql --help | findstr cnf
128+
129+
.. tab:: MacOS / Linux
130+
:tabid: macos-linux
131+
132+
.. code-block::
133+
:copyable: true
134+
135+
mysql --help | grep cnf
136+
137+
#. Under the ``[mysqld]`` section of your MySQL
138+
configuration file add the following lines. Replace
139+
the ``XXXXX`` value with the ``server_id`` from the
140+
previous query:
141+
142+
.. tabs::
143+
144+
.. tab:: MySql 8.x
145+
:tabid: mysql-8x
146+
147+
.. code-block::
148+
:copyable: true
149+
150+
server-id = XXXXX
151+
log_bin = mysql-bin
152+
binlog_format = ROW
153+
binlog_row_image = FULL
154+
binlog_expire_logs_seconds = 864000
155+
156+
.. tab:: MySql 5.x
157+
:tabid: mysql-5x
158+
159+
.. code-block::
160+
:copyable: true
161+
162+
server-id = XXXXX
163+
log_bin = mysql-bin
164+
binlog_format = ROW
165+
binlog_row_image = FULL
166+
expire_log_days = 10
167+
168+
.. note::
169+
170+
If you're running MySQL on AWS RDS and `automated backups
171+
<https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html>`__
172+
are not enabled, ``Binlog`` will be disabled, even if
173+
the values are set in the configuration file.
174+
175+
Learn More
176+
----------
177+
178+
Relational Migrator relies on the open-source Debezium connector to
179+
capture row-level changes. For more details, see
180+
`Debezium MySQL <https://debezium.io/documentation/reference/stable/connectors/mysql.html>`__.

source/prerequisites/oracle.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _rm-prereq-oracle:
22

3-
==============================
4-
Oracle Migration Prerequisites
5-
==============================
3+
============================================
4+
Configure Migration Prerequisites for Oracle
5+
============================================
66

77
.. contents:: On this page
88
:local:

source/prerequisites/postgres.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _rm-prereq-postgres:
22

3-
================================
4-
Postgres Migration Prerequisites
5-
================================
3+
================================================
4+
Configure Migration Prerequisites for PostgreSQL
5+
================================================
66

77
.. contents:: On this page
88
:local:

source/prerequisites/sql-server.txt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _rm-prereq-sqlserver:
22

3-
==================================
4-
SQL Server Migration Prerequisites
5-
==================================
3+
================================================
4+
Configure Migration Prerequisites for SQL Server
5+
================================================
66

77
.. contents:: On this page
88
:local:
@@ -21,9 +21,7 @@ perform their execution on the database server. This topic
2121
provides more details on the required configuration steps. SQL Server
2222
configuration depends on the type of sync job:
2323

24-
- Snapshot sync jobs migrate all the data and then stops.
25-
- Continuous sync job run a snapshot and then enter a CDC stage to
26-
continuously replicate data changes.
24+
.. include:: /includes/fact-short-sync-job-desc.rst
2725

2826
About this Task
2927
---------------
@@ -69,7 +67,7 @@ job configurations.
6967
unchanged, and does not add any performance overhead. Enabling
7068
CDC alone does not result in changes being captured.
7169

72-
.. include:: /includes/fact-enable-cdc-database.rst
70+
.. include:: /includes/fact-enable-cdc-database.rst
7371

7472
.. tab:: Continuous Jobs
7573
:tabid: enable-continuous-jobs

source/prerequisites/sybase.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.. _rm-prereq-mysql:
2+
3+
============================================
4+
Configure Migration Prerequisites for Sybase
5+
============================================
6+
7+
.. contents:: On this page
8+
:local:
9+
:backlinks: none
10+
:depth: 1
11+
:class: singlecol
12+
13+
There are no prerequisite requirements to use Relational Migrator with
14+
Sybase ASE. Sybase only supports snapshot sync jobs.

0 commit comments

Comments
 (0)