Install MySQL to realize remote access link --- no local access required

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

The Synology installation of MySQL has the advantages of high 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. Through simple settings, we can realize remote access to mysql in Synology, which relieves the distress of only local access.

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

1. Install MySQL

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

image-20230612132328083

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

image-20230612132752265

After the setting is complete, click Finish to start the installation

image-20230612132834075

After the installation is complete, we open the configuration interface, open the TCP/IP connection, check it and click Apply

image-20230612163302209

2. Install phpMyAdmin

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

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

image-20230612161118491

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

image-20230612161245401

After the installation is complete, we can find it in the list of "installed" packages phpMyAdmin, open

image-20230612161426262

Enter the database user name rootand the password we set when we installed the database above, and log in

image-20230612161548749

3. Modify the User table

After logging in, click on the mysql database

image-20230612162420450

Find the user table

image-20230612162514838

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

image-20230612162724026

Change it to %indicate that ip access is not restricted, so that you can remote mysql after modification

image-20230612162829516

Then find the installed one in the Synology Package Center mariadb, stop, then restart, let our modified configuration take effect

image-20230612163005876

4. Local test connection

Open the database connection tool, enter the LAN ip address of Synology, enter the database user name and password, and click Test Connection, and the display of successful! means success!

image-20230612163529109

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 套件中心, 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, click 下一步the button all the way to complete the installation.

20221117182230

In the external browser, we 群晖的局域网ip地址add 9200the port, the cpolar web management interface, the default port is 9200, enter the cpolar email account and password to log in

image-20230612165349594

6. Configure the public network access address

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

  • Tunnel name: 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创建

image-20230612171131294

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

image-20230612171200040

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 at the same time, click test connection, and the connection is successful, indicating ok.

image-20230612171414686

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, which will not change, and there is no need to modify the address repeatedly every day after setting.

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

Log in to the cpolar official website, click on the reservation on the left, find the reserved tcp address, let's reserve a fixed tcp address for Minecraft:

  • Region: Select China
  • Description: It is a note, which can be customized

click保留

image-20230612171657536

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

image-20230612171808792

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

image-20230612171900611

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 on the official website,

click更新

image-20230612171930707

After the tunnel is successfully updated, click the status on the left dashboard - the list of online tunnels, and you can see that the public network address has been updated to a fixed tcp address.

image-20230612171955453

We fixed the mysql connection address above, now we use the fixed public network address connection test, open the mysql connection tool, enter the public network address and the corresponding public network port, enter the user name and password at the same time, click the test connection, it will appear successful! means ok, such a remote fixed mysql connection address on the Synology NAS is set.

image-20230612172127598

Guess you like

Origin blog.csdn.net/ljq_up/article/details/131456930