mysql deb linux_mysql学习笔记:二.linux中mysql的安装

linux中mysql的安装

源代码:编译安装

二进制格式的程序包:展开至特定路径,并经过简单配置后即可使用(常见的以tar.gz结尾)

程序包管理器管理的程序包(yum或dnf方式安装):

rpm:有两种

OS Vendor:操作系统发行商提供的

项目官方提供的

deb

docker部署,生产环境数据库一般不使用容器部署,但作为测试的快速部署很方便

安装方式总结:

docker部署

[root@localhost ~]# docker run -itd --name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql:5.7.30

Unable to find image 'mysql:5.7.30' locally

5.7.30: Pulling from library/mysql

8559a31e96f4: Pull complete

d51ce1c2e575: Pull complete

c2344adc4858: Pull complete

fcf3ceff18fc: Pull complete

16da0c38dc5b: Pull complete

b905d1797e97: Pull complete

4b50d1c6b05c: Pull complete

d85174a87144: Pull complete

a4ad33703fa8: Pull complete

f7a5433ce20d: Pull complete

3dcd2a278b4a: Pull complete

Digest: sha256:32f9d9a069f7a735e28fd44ea944d53c61f990ba71460c5c183e610854ca4854

Status: Downloaded newer image for mysql:5.7.30

669eddc896b9d0603e790ac2de173e584f287d9d9f864a86360e277fef12e74c

[root@localhost ~]# ss -tanl

State Recv-Q Send-Q Local Address:Port Peer Address:Port

LISTEN 0 100 127.0.0.1:25 *:*

LISTEN 0 128 *:3306 *:*

LISTEN 0 128 *:22 *:*

LISTEN 0 100 [::1]:25 [::]:*

LISTEN 0 128 [::]:22 [::]:*

登录

[root@localhost ~]# mysql -uroot -h127.0.0.1 -p123456

Welcome to the MariaDB monitor. Commands end with ; or \g.

Your MySQL connection id is 2

Server version: 5.7.30 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MySQL [(none)]>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值