当前位置:网站首页>Docker installs MySQL and uses Navicat to connect
Docker installs MySQL and uses Navicat to connect
2022-07-05 06:59:00 【Silence, your name】
Create a mapping directory , I installed it in the user directory
mkdir ~/mysql
mkdir ~/mysql/conf
mkdir ~/mysql/logs
mkdir ~/mysql/data
Execute the above commands respectively , Create file directory
# start-up docker run -id \ -p 3306:3306 \ --name=mysql \ -v $PWD/conf:/etc/mysql/conf.d \ -v $PWD/logs:/logs \ -v $PWD/data:/var/lib/mysql \ -e MYSQL_ROOT_PASSWORD=123456 \ -d mysql \ --character-set-server=utf8mb4 \ --collation-server=utf8mb4_general_ci
# explain
docker run Create a new container , Run this container at the same time -p 3306:3306 Set port mapping Exposed ports : Container port --name The name of the container after startup -v Volume mount Out of container Directory : In-container directory –restart unless-stopped Container restart strategy -e MYSQL_ROOT_PASSWORD=root Set up root User's password , After the container is started, it is used for login mysql \ shell Command line break $PWD Current user directory
Due to the use of $PWD So you need to get into mysql Catalog cd ~/mysql And then execute docker command
Look at the container Whether the startup is successful docker ps
Into the container docker exec -it mysql bash
Sign in msyql mysql -uroot -p123456
Create user
CREATE USER 'silence'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
Authorized user remote login
GRANT ALL PRIVILEGES ON *.* TO 'silence'@'%';
navicat Connect
边栏推荐
- NVM Downloading npm version 6.7.0... Error
- LSA Type Explanation - lsa-1 [type 1 LSA - router LSA] detailed explanation
- 逻辑结构与物理结构
- Integer to 8-bit binary explanation (including positive and negative numbers) scope of application -127~+127
- Record of problems in ollvm compilation
- [nvidia] CUDA_ VISIBLE_ DEVICES
- Unity UGUI不同的UI面板或者UI之间如何进行坐标匹配和变换
- [MySQL 8.0 does not support capitalization of table names - corresponding scheme]
- Build a microservice cluster environment locally and learn to deploy automatically
- kata container
猜你喜欢
随机推荐
PHY驱动调试之 --- PHY控制器驱动(二)
IPage能正常显示数据,但是total一直等于0
Utf8 encoding
Orin 安装CUDA环境
The difference between new and malloc
Configuration method and configuration file of SolidWorks GB profile library
Error: "mountvolume.setup failed for volume PVC fault handling
[MySQL 8.0 does not support capitalization of table names - corresponding scheme]
MySQL setting trigger problem
About vscode, "code unreachable" will be displayed when calling sendline series functions with pwntools“
Rehabilitation type force deduction brush question notes D2
乐鑫面试流程
睿智的目标检测59——Pytorch Focal loss详解与在YoloV4当中的实现
Volcano resource reservation feature
Financial risk control practice -- feature derivation based on time series
Executealways of unity is replacing executeineditmode
postmessage通信
1. Create Oracle database manually
6-3 find the table length of the linked table
Matlab在线性代数中的应用(四):相似矩阵及二次型