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

Two methods to implement Mysql remote connection configuration

Two methods to implement Mysql remote connection ...

How to use cutecom for serial communication in Ubuntu virtual machine

Using cutecom for serial communication in Ubuntu ...

Tutorial on installing mysql5.7.18 on mac os10.12

I searched the entire web and found all kinds of ...

How to block IP and IP range in Nginx

Written in front Nginx is not just a reverse prox...

Detailed explanation of COLLATION examples in MySQL that you may have overlooked

Preface The string types of MySQL database are CH...

jQuery simulates picker to achieve sliding selection effect

This article shares the specific code of jQuery t...

Explanation of the steps for Tomcat to support https access

How to make tomcat support https access step: (1)...

How to use HTML 5 drag and drop API in Vue

The Drag and Drop API adds draggable elements to ...

Independent implementation of nginx container configuration file

Create a container [root@server1 ~]# docker run -...

Syntax alias problem based on delete in mysql

Table of contents MySQL delete syntax alias probl...

Detailed explanation of generic cases in TypeScript

Definition of Generics // Requirement 1: Generics...

How to directly reference vue and element-ui in html

The code looks like this: <!DOCTYPE html> &...