Synology NAS installs Mysql remote access connection very accurately

Reprinted from cpolar pole cloud article: Synology NAS installs MySQL remote access connection

Synology's MySQL installation has the advantages of efficiency, security, reliability, and flexibility, and can provide users with an excellent data management and analysis environment. At the same time, it has good hardware performance and stability, which can ensure the efficient operation and data security of the MySQL database.

cpolar is an intranet penetration tool. With simple settings, we can remotely access MySQL in Synology, eliminating the trouble of only local access.

cpolar official website: https://www.cpolar.com

1. Install MySQL

In the Synology Package Center, we search mariadb, and after the search results come out, click Install

[External link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-QgfivLl3-1692014583861)(https://images.cpolar.com//img/image-20230612132328083.png) ]

During the installation process, you will be prompted to set a password. You need to set a password.

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-XVHi2rxP-1692014583915)(https://images.cpolar.com//img/image-20230612132752265.png) ]

After the settings are completed, click Finish to start the installation

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-A9gb74qC-1692014583921)(https://images.cpolar.com//img/image-20230612132834075.png) ]

After the installation is completed, we open the configuration interface, enable the TCP/IP connection, check the box and click Apply

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-tcbPobJG-1692014583926)(https://images.cpolar.com//img/image-20230612163302209.png) ]

2. Install phpMyAdmin

After we installed the database above, we need to modify rootthe user access method in the data table so that we can access it remotely, so we need to install phpMyAdmin to modify the relevant parameters.

To run it we need to install the PHP7.4 version environment, so we search for it in the package center php 7.4and install it.

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-NvXIAEvu-1692014583930)(https://images.cpolar.com//img/image-20230612161118491.png) ]

After the installation is complete, search in the Package Center again phpMyAdminand click Install

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-3W8e6sjn-1692014583933)(https://images.cpolar.com//img/image-20230612161245401.png) ]

After the installation is complete, we find it in the "Installed" package list phpMyAdminand open it.

[External link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-q5LcdM5W-1692014583937)(https://images.cpolar.com//img/image-20230612161426262.png) ]

Enter the database username rootand the password we set when installing the database above, and log in

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-KFhZGEpu-1692014583941)(https://images.cpolar.com//img/image-20230612161548749.png) ]

3. Modify the User table

After logging in, click on the mysql database

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-YCmEV6Pr-1692014583945)(https://images.cpolar.com//img/image-20230612162420450.png) ]

Find the user table

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-J8mCVFO5-1692014583949)(https://images.cpolar.com//img/image-20230612162514838.png) ]

Double-click to modify the localhost value under the Host field in the table

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-FAvXWZAe-1692014583953)(https://images.cpolar.com//img/image-20230612162724026.png) ]

Change to %, indicating that IP access is not restricted, so that after modification, remote mysql can be used

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-j11hstsa-1692014583958)(https://images.cpolar.com//img/image-20230612162829516.png) ]

Then find the installed one in Synology Package Center mariadb, stop it, and then restart it to make the configuration we modified take effect.

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-4rHPVKyT-1692014583963)(https://images.cpolar.com//img/image-20230612163005876.png) ]

4. Local test connection

Open the database connection tool, enter Synology's LAN IP address, enter the database user name and password, click Test Connection, success! will appear, indicating success!

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-uUNpkdJD-1692014583968)(https://images.cpolar.com//img/image-20230612163529109.png) ]

5. Install cpolar

cpolar Synology suite download address: https://www.cpolar.com/synology-cpolar-suite, download the corresponding version of the suite

20221222170135

To open it 套件中心, click 手动安装the button in the upper right corner.

20221117182200

Select the cpolar installation package we downloaded locally.

20221117182209

click 下一步button

20221117182214

click 同意button

20221117182222

After that, just click 下一步the button all the way to complete the installation.

20221117182230

In the external browser, we 群晖的局域网ip地址add 9200the port to cpolar's Web management interface. The default port is 9200. Enter the cpolar email account and password to log in.

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-07nl5bDj-1692014583998)(https://images.cpolar.com//img/image-20230612165349594.png) ]

6. Configure public network access address

After successful login, click Tunnel Management - Create Tunnel on the left dashboard:

  • Tunnel name: It can be customized. Be careful not to duplicate the existing tunnel name.
  • Protocol: tcp
  • Local address: 3306
  • Port type: Temporary random TCP port
  • Region: Select China

Click创建

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-xY0bqrD3-1692014584001)(https://images.cpolar.com//img/image-20230612171131294.png) ]

Then open the online tunnel list and check the mysql public network connection address of the tcp protocol.

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-mYZC5eqp-1692014584006)(https://images.cpolar.com//img/image-20230612171200040.png) ]

Next, we use the public network address to connect, open the mysql connection tool, enter the public network address and the corresponding public network port, enter the user name and password, and click Test Connection. If the connection is successful, it means ok.

[External link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-Mxmld4SH-1692014584010)(https://images.cpolar.com//img/image-20230612171414686.png) ]

7. Fixed connection public network address

It should be noted that the above steps use a random temporary TCP port address, and the generated public network address is a random temporary address, which will change randomly within 24 hours. Next, we configure a fixed TCP port address for it. This address will not change. After setting it, there will be no need to modify the address repeatedly every day.

cpolar official website: https://dashboard.cpolar.com/login

Log in to the cpolar official website, click Reserve on the left, and find the reserved TCP address. Let’s reserve a fixed TCP address for Minecraft:

  • Region: Select China
  • Description: Notes, customizable

Click保留

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-EEoW39Td-1692014584014)(https://images.cpolar.com//img/image-20230612171657536.png) ]

After the address is successfully reserved, the system will generate the corresponding fixed public address and copy it.

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-Zm98iDrV-1692014584018)(https://images.cpolar.com//img/image-20230612171808792.png) ]

Enter the cpolar web ui management interface, click Tunnel Management - Tunnel List on the left dashboard, find the tcp tunnel we created above, and click on the right编辑

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-13QrwGJs-1692014584023)(https://images.cpolar.com//img/image-20230612171900611.png) ]

Modify the tunnel information and configure the successfully reserved fixed tcp address into the tunnel.

  • Port type: modified to fixed tcp port
  • Reserved tcp address: fill in the address successfully reserved by the official website,

Click更新

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-ffGee3cl-1692014584026)(https://images.cpolar.com//img/image-20230612171930707.png) ]

After the tunnel is successfully updated, click the status on the left dashboard - Online Tunnel List, and you can see that the public network address has been updated to a fixed TCP address.

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-X9wYTNz5-1692014584030)(https://images.cpolar.com//img/image-20230612171955453.png) ]

Above we fixed the mysql connection address. Now we use the fixed public address to connect to the test. Open the mysql connection tool, enter the public address and corresponding public port, enter the user name and password at the same time, click test connection, and success! means ok. , such a remote fixed mysql connection address on Synology NAS is set.

[External link pictures are being transferred...(img-X9wYTNz5-1692014584030)]

Above we fixed the mysql connection address. Now we use the fixed public address to connect to the test. Open the mysql connection tool, enter the public address and corresponding public port, enter the user name and password at the same time, click test connection, and success! means ok. , such a remote fixed mysql connection address on Synology NAS is set.

[The external link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-s767IQr5-1692014584033)(https://images.cpolar.com//img/image-20230612172127598.png) ]

Guess you like

Origin blog.csdn.net/m0_67768006/article/details/132283532