当前位置:网站首页>Navicate connects Alibaba cloud (explanation of two methods and principles)
Navicate connects Alibaba cloud (explanation of two methods and principles)
2022-07-24 17:06:00 【Hua Weiyun】
One 、 Direct connection ( adopt 3306 port )
1. summary
Turn on the server's 3306 port , add to MySQL Remote access users , It can realize direct connection to remote MySQL The function of , The effect is to directly localhost Change to server public network IP You can access .
2. Environmental preparation
Local :Navicat
The server : Alibaba cloud ECS、 Install well JDK、MySQL
3. Operation and explanation
(1) Open server security group 3306 port
Open the ECS 3306 Ports have certain security risks , The default security group does not allow external access 3306 Port of .
Log in to alicloud –》 Console –》 Find your own cloud server ECS–》 Click the instance after entering ID

Click this instance security group –》 Select configuration rules –》 Add a piece of configuration information 
(2) add to MySQL Remote access users
After installation MySQL There is a... In the database mysql library , There's one in the library user surface , This table stores mysql User information for , By default, it's like this [ Outside the chain 
Only allow local passage root The account login ( Don't pay attention to the other two ), We now add a user with remote access, namely Host by % Users of .
adopt shell Tools connect to server , Sign in mysql Run the following command
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;flush privileges; Add one that can punch any IP Login account , Account No root, The password for 123456. The second sentence is refresh permission , It doesn't matter if you don't refresh .
(3) Via local Navicat Connect remote MySQL database
Above, we have configured the security group access control , Configured with MySQL Remote login user , Then we can access directly and remotely MySQL 了 .

Connection name : at will
host : The server IP Address
port :3306
user name :root
password :123456
Compared with the local database, only one has been changed IP The address can be connected . Projects can also be directly linked to information localhost Change to IP The address directly accesses the cloud database .
Two 、 Use SSH passageway
1. summary
to open up 3306 The port has certain security risks , The project and database are stored on a server , No need to go through the public network IP visit , When developing, you need to connect to the database locally , have access to SSH Connect to the database by channel connection , Connect to the server locally through the server account password , Then connect MySQL, about MySQL This is a local access connection .
2. Environmental preparation
Local :Navicat
The server : Alibaba cloud ECS、 Install well JDK、MySQL
3. Operation and explanation
This method does not need to develop security group ports , It's not necessary for MySQL Add remote access user . Use SSH The channel uses the server login account to connect MySQL.
(1) To configure SSH Connect

Selected when connecting SSH Options , Select use SSH passageway
host : Server public network IP
port :22(SSH Connection port , Alibaba cloud security group is released by default )
user name : Login the user name of the server system ( Notice that it's not MySQL Of )
password : The password to log in to the server system ( Notice that it's not MySQL Of )
The above behavior is equivalent to shell Connected to the server
(2) Configure the database connection information

Normal operation ,
Host name : at will .
host :localhost
port :3306
user name :mysql user name
password :mysql password
Because already SSH Connected to the server , This is equivalent to local connection MySQL.

Navicat The picture given is very vivid ,Navicat Connect to server , Then connect the database directly inside
If it helps you , Don't forget to praise you , You can ask questions , Bloggers come to visit every day .
边栏推荐
猜你喜欢

MODIS data WGet Download
ShardingSphere数据库读写分离

Safety: how to provide more protection for pedestrians

Why should we launch getaverse?

Internet Download Manager配置

Axi protocol (2): five channels and two transactions of Axi architecture

Custom types: Enumeration

socat 端口转发

Qsqldatabase: solution of qmmysql driver not loaded

量化框架backtrader之一文读懂Indicator指标
随机推荐
Long awaited full platform support - Open Source im project uniapp update of openim
JS to implement a promise of promises/a+ specification
Sword finger offer 48. the longest substring without repeated characters
会议OA项目进度(一)
自定义类型:枚举
CANN训练营学习2022第二季 模型系列 动漫风格化和AOE ATC调优
内核开发
How to effectively avoid memory leakage when customizing the handler?
PAT甲级——拼写正确
Shardingsphere database read / write separation
Kernel development
1163: SongGe's score splitting (C language)
Canvas from getting started to persuading friends to give up (graphic version)
Sword finger offer 22. the penultimate node in the linked list
QT graphical interface beginner project - unmanned aerial vehicle group combat simulation
ArcGIS create vector
MODIS 16 day data monthly / quarterly synthesis
OS Experiment 5 process switching based on kernel stack switching
1024 happy holidays
剑指 Offer 48. 最长不含重复字符的子字符串