Local Navicat and back-end projects are connected to the MySql database on the Aliyun server (pagoda)

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

NavicatI 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".

insert image description here

3.2 Fill in the information and click "OK".

insert image description here

  • port: 3306( MySqlthe port number is by default 3306);
  • 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)
    [External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-c7hZNxHm-1689058951639)(https://note.youdao.com/yws/res/25624/WEBRESOURCE613653b6c43508a23f534979fc186c0a)]

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".

insert image description here

3.4 Fill in the rules and click "OK".

insert image description here

  • Port rule: 3306( MySqlthe default port number is 3306);
  • 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 rootthe password of the account.

insert image description here

3.6 Copy this password, it will be used later.

insert image description here

3.7 Click "phpMyAdmin" and select "Authorized Access".

insert image description here

3.8 Enter the password you just copied, and click "Login".

insert image description here

3.9 Enter "phpMyAdmin", in the tree on the left, select the database that needs to be accessed locally, and click "Permissions".

insert image description here

3.10 Click "Add User Account".

insert image description here

3.11 Fill in the form and click "Execute".

insert image description here
insert image description here

3.12 Go back to the local Navicat, test to connect to the MySql database of Alibaba Cloud, and the connection is successful.

insert image description here

Guess you like

Origin blog.csdn.net/u010657801/article/details/131660546