Reference: https://www.31idc.com/helpcontent/346.html
1. Environmental Description
- Server type: lightweight application server;
- system image:
Alibaba Cloud Linux
; - Panel: Pagoda Linux panel;
2. Scenario Description
Navicat
I want to connect to the database built on the server in the code of the local and back-end projects MySql
.
3. Operation steps
3.1 Log in to the Pagoda panel, enter "Security", and click "Add Port Rule".
3.2 Fill in the information and click "OK".
- port:
3306
(MySql
the port number is by default3306
); - Source: Select "Specify IP";
- ip address: fill in the local IP address; (if you don’t know how to query, you can open "Baidu" and search for "ip address", and the local address will be displayed in the search results, as shown in the figure below)
3.3 In the firewall of the Alibaba Cloud server, this rule must also be added. Enter Alibaba Cloud's workbench, "Security" - "Firewall", click "Add Rule".
3.4 Fill in the rules and click "OK".
- Port rule:
3306
(MySql
the default port number is3306
); - Limit IP source: fill in the local IP address;
3.5 (The steps of installing MySql and creating a database will not be explained here) Go back to the pagoda panel, click on the database, enter MySql
, click on "root password" to get root
the password of the account.
3.6 Copy this password, it will be used later.
3.7 Click "phpMyAdmin" and select "Authorized Access".
3.8 Enter the password you just copied, and click "Login".
3.9 Enter "phpMyAdmin", in the tree on the left, select the database that needs to be accessed locally, and click "Permissions".
3.10 Click "Add User Account".
3.11 Fill in the form and click "Execute".