How to connect Navicat to the docker database on the server

How to connect Navicat to the docker database on the server

Start the mysql container in docekr

Use command:

docker run -p 3306:3306 --name mysql01 -e MYSQL_ROOT_PASSWORD=xxx -d mysql:5.7

-p 3306:3306 means mapping port 3306 in docker to port 3306 on the host. –name mysql01 means the container is named mysql01
-e MYSQL_ROOT_PASSWORD=xxx Set the password of mysql, which will be used later
-d mysql:5.7 Use mysql image

Results after successful operation

insert image description here

Open the server port 3306 for access

Configure inbound rules in the security group to allow remote access to port 3306.

insert image description here

Navcat Visits

Click File, Create New Connection
insert image description here

The connection name is the server IP address. The password is the password used to enable the Docker container configuration above. Click OK to connect.

This is the end of this article about Navicat connecting to the docker database on the server side. For more information about Navicat connecting to the docker database, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Perfect solution to the problem that Navicat cannot connect after installing mysql in docker
  • After installing Navicat in MySQL, 2059 appears, Authentication plugin and local link virtual machine docker, remote link server

<<:  Basic HTML directory problem (difference between relative path and absolute path)

>>:  CSS scroll-snap scroll event stop and element position detection implementation

Recommend

Briefly describe the difference between MySQL and Oracle

1. Oracle is a large database while MySQL is a sm...

Vue encapsulates the public function method of exporting Excel data

vue+element UI encapsulates a public function to ...

Native JS to achieve special effects message box

This article shares with you a special effect mes...

The complete implementation process of Sudoku using JavaScript

Table of contents Preface How to solve Sudoku Fil...

Summary of commonly used performance test scripts for VPS servers

Here is a common one-click performance test scrip...

Detailed steps to use Arthas in a Docker container

What can Arthas do for you? Arthas is Alibaba'...

MySQL join buffer principle

Table of contents 1. MySQL join buffer 2. JoinBuf...

A complete list of commonly used MySQL functions (classified and summarized)

1. Mathematical Functions ABS(x) returns the abso...

How to limit the value range of object keys in TypeScript

When we use TypeScript, we want to use the type s...

mysql8 Common Table Expression CTE usage example analysis

This article uses an example to describe how to u...

How to use CocosCreator object pool

Table of contents Preface: Specific operations St...

Detailed analysis of compiling and installing vsFTP 3.0.3

Vulnerability Details VSFTP is a set of FTP serve...