Article Directory
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
During the installation process, you will be prompted to set a password, and you need to set a password
After the setting is complete, click Finish to start the installation
After the installation is complete, we open the configuration interface, open the TCP/IP connection, check it and click Apply
2. Install phpMyAdmin
After we installed the database above, we need to modify root
the 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.4
and install it.
After the installation is complete, search again in the Package Center phpMyAdmin
, and click Install
After the installation is complete, we can find it in the list of "installed" packages phpMyAdmin
, open
Enter the database user name root
and the password we set when we installed the database above, and log in
3. Modify the User table
After logging in, click on the mysql database
Find the user table
Double-click to modify the localhost value under the Host field in the table
Change it to %
indicate that ip access is not restricted, so that you can remote mysql after modification
Then find the installed one in the Synology Package Center mariadb
, stop, then restart, let our modified configuration take effect
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!
5. Install cpolar
cpolar Synology suite download address: https://www.cpolar.com/synology-cpolar-suite, download the corresponding version of the suite
To open 套件中心
, click 手动安装
the button in the upper right corner.
Select the cpolar installation package we downloaded locally.
click 下一步
button
click 同意
button
After that, click 下一步
the button all the way to complete the installation.
In the external browser, we 群晖的局域网ip地址
add 9200
the port, the cpolar web management interface, the default port is 9200, enter the cpolar email account and password to log in
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创建
Then open the online tunnel list and view the mysql public network connection address of the tcp protocol.
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.
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保留
After the address is successfully reserved, the system will generate a corresponding fixed public network address and copy it down
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编辑
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更新
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.
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.