当前位置:网站首页>Alibaba cloud server docker installation mysql5.5
Alibaba cloud server docker installation mysql5.5
2022-07-06 16:56:00 【LuckyShawn】
Aliyun server docker install mysql5.5
1.docker pull mysql Pull the mirror image
Personal feeling mysql5.5 The version is relatively stable , So choose 5.5 edition
Enter the command to download mysql5.5 Image of version
docker pull mysql:5.5
2. adopt docker image You can view the pulled image
docker images | grep mysql see mysql Mirror image
3. function mysql Containers
docker run -p 3306:3306 --name shawnmysql -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD= Input password -d mysql:5.5
Command specification :
-p 3306:3306: The container of 3306 Port mapping to host's 3306 port .
-v $PWD/conf:/etc/mysql/conf.d: Will host the current directory of conf/my.cnf Attached to the container /etc/mysql/my.cnf.
-v $PWD/logs:/logs: Will host the current directory of logs The directory is attached to the container's /logs.
-v $PWD/data:/var/lib/mysql : Will host the current directory of data The directory is attached to the container's /var/lib/mysql .
-e MYSQL_ROOT_PASSWORD=123456: initialization root User's password .
4. View the running container
docker ps
5. Enter container enter mysql
docker exec -it containerId /bin/bash
You can operate the database directly
complete !
边栏推荐
- ~76 sprite map
- ~78 radial gradient
- 姚班智班齐上阵,竞赛高手聚一堂,这是什么神仙编程大赛?
- ~79 Movie card exercise
- The QT program compiled on CentOS lacks a MySQL driven solution
- Some instructions on whether to call destructor when QT window closes and application stops
- TypeScript基本操作
- ~82 style of table
- 字节跳动海外技术团队再夺冠:高清视频编码已获17项第一
- was unable to send heartbeat
猜你喜欢
字节跳动新程序员成长秘诀:那些闪闪发光的宝藏mentor们
Cmake Express
redux使用说明
The 116 students spent three days reproducing the ByteDance internal real technology project
~82 style of table
Which is more important for programming, practice or theory [there are some things recently, I don't have time to write an article, so I'll post an article on hydrology, and I'll fill in later]
README. txt
算数运算指令
逻辑运算指令
[graduation project] QT from introduction to practice: realize imitation of QQ communication, which is also the last blog post in school.
随机推荐
Mongodb在node中的使用
LeetCode 1638. Count the number of substrings with only one character difference
我走过最迷的路,是字节跳动程序员的脑回路
Fdog series (III): use Tencent cloud SMS interface to send SMS, write database, deploy to server, web finale.
Sublime text code formatting operation
Eureka high availability
Tencent interview algorithm question
字节跳动技术新人培训全记录:校招萌新成长指南
One hundred questions of image processing (11-20)
QT system learning series: 1.2 style sheet sub control lookup
LeetCode 1566. Repeat the pattern with length m at least k times
The QT program compiled on CentOS lacks a MySQL driven solution
Basic principles of video compression coding and audio compression coding
TCP的三次握手和四次挥手
Fdog series (I): think about it. It's better to write a chat software. Then start with the imitation QQ registration page.
数据传送指令
Jedis
LeetCode 1636. Sort the array in ascending order by frequency
~75 background
The "advertising maniacs" in this group of programmers turned Tiktok advertisements into ar games