dbForge Studio for MySQL allows users to version-control database schemas and data, roll back unwanted changes, handle static data conflicts, and maintain database integrity. The tool helps link a database to Git, a distributed version control system.
Before you start, install Git for a Windows client on the machine you’ll be version-controlling a database.
To link a database to a remote repository, you must have a cloned copy of the remote repository, which may be hosted on platforms such as GitHub or GitLab or created locally using the git init --bare
Git command.
See how to clone a remote repository and link a database to a Git repository in GitHub.
When dbForge Studio connects to a Git repository, is the connection secure? In other words, is TLS enabled?
dbForge Studio connects to Git using the standard Git client for Windows, which supports current security protocols, including TLS 1.2. Secure connections are established when the server both supports them and requires them. For instance, if a repository’s address begins with HTTPS and the server stipulates the use of TLS, the connection will comply with these security requirements. The choice of security protocol is determined by the server’s configuration, not by dbForge settings.
See the following how-to topics to learn how to clone a remote repository and link a database to a Git repository in:
dbForge Studio doesn’t work with either local or remote repositories directly – only through a clone. Therefore, you will need to create a local Git repository and then clone it.
For this, perform the following steps:
1. Create two empty folders on the disk of your computer where the local repository will be stored.
2. Start Windows Command Prompt (CMD).
Note
To navigate to the folder where the main local repository will be located, in the Command Prompt, use the
cd
command.
3. Type git init --bare
to create the main repository locally.
4. Navigate to the second folder and clone the local repository you have just created using git clone <pathToMainRepo>
. Make sure to place a dot at the end of the command to clone the repository to the folder you have created. Otherwise, another subfolder will be created.
Note
<pathToMainRepo>
is the path to the main repository you created locally when executing thegit init --bare
command.
5. Execute these CMD commands in the folder in question:
git commit --allow-empty -m initial
to make an initial commitgit push
to push the changes to the remote repository6. Link source control to that folder in the following order:
Alternatively, navigate to the main Database menu and select Link Database to Source Control.
In the Link Database to Source Control dialog, click + in the Source control repository field to enter the source control repository properties.
In the Source Control Repository Properties dialog, do the following:
Optional: Click Test to verify that the database has successfully been connected to source control.
Click OK to apply the changes and close the Source Control Repository Properties dialog.
7. Select a database development model: shared or dedicated.
8. Click Link to establish the connection between the database and source control.
The Refresh progress window opens automatically, showing the stages of the refresh operation. The linked database gets the following icon in Database Explorer: