mysql二进制安装

这篇博客介绍了如何在Linux系统上进行MySQL的二进制安装,包括下载安装包、配置环境变量、初始化数据库及修改密码。此外,还详细讲解了数据库密码破解的步骤,包括编辑配置文件启用skip-grant-tables、重启服务、密码修改以及验证新密码的过程。
摘要由CSDN通过智能技术生成

mysql进阶(上)


1. 二进制安装mysql

//下载二进制格式的mysql软件包

[root@150 ~]# cd /usr/src
[root@150 src]# wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz
--2022-07-26 18:25:40--  https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz
Resolving downloads.mysql.com (downloads.mysql.com)... 23.76.76.109, 2402:4f00:4002:194::2e31, 2402:4f00:4002:182::2e31
Connecting to downloads.mysql.com (downloads.mysql.com)|23.76.76.109|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz [following]
--2022-07-26 18:25:41--  https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz
Resolving cdn.mysql.com (cdn.mysql.com)... 23.194.211.12
Connecting to cdn.mysql.com (cdn.mysql.com)|23.194.211.12|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 674830866 (644M) [application/x-tar-gz]
Saving to: ‘mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz’

mysql-5.7.38-linux-glibc2.12-x86_64.tar.g 100%[===================================================================================>] 643.57M  28.3MB/s    in 25s

2022-07-26 18:26:07 (25.3 MB/s) - ‘mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz’ saved [674830866/674830866]

[root@150 src]# ls
annobin  debug  kernels  mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz  mysql57-community-release-el7-11.noarch.rpm
[root@150 src]#

//创建用户和组

[root@150 src]# groupadd -r mysql
[root@150 src]# useradd -M -r -s  /sbin/nologin -g mysql mysql
[root@150 src]# id mysql
uid=299(mysql) gid=299(mysql) groups=299(mysql)
[root@150 src]#

//解压软件至/usr/local/

[root@150 src]# tar xf mysql-5.7.38-linux-glibc2.12-x86_64.tar.gz -C /usr/local/
[root@150 src]# ls /usr/local
apache  apr  apr-until  bin  etc  games  include  lib  lib64  libexec  mysql-5.7.38-linux-glibc2.12-x86_64  nginx  sbin  share  src
[root@150 src]# cd /usr/local/
[root@150 local]#
[root@150 local]#
[root@150 local]# ln -sv mysql-5.7.38-linux-glibc2.12-x86_64/  mysql
'mysql' -> 'mysql-5.7.38-linux-glibc2.12-x86_64/'
[root@150 local]# ll
total 0
drwxr-xr-x. 14 root root 164 Jul 14 18:59 apache
drwxr-xr-x.  6 root root  58 Jul 14 18:49 apr
drwxr-xr-x.  5 root root  43 Jul 14 18:54 apr-until
drwxr-xr-x.  2 root root   6 Jun 22  2021 bin
drwxr-xr-x.  2 root root   6 Jun 22  2021 etc
drwxr-xr-x.  2 root root   6 Jun 22  2021 games
drwxr-xr-x.  2 root root   6 Jun 22  2021 include
drwxr-xr-x.  2 root root   6 Jun 22  2021 lib
drwxr-xr-x.  3 root root  17 Jun 27 14:18 lib64
drwxr-xr-x.  2 root root   6 Jun 22  2021 libexec
lrwxrwxrwx.  1 root root  36 Jul 26 18:36 mysql -> mysql-5.7.38-linux-glibc2.12-x86_64/
drwxr-xr-x.  9 root root 129 Jul 26 18:33 mysql-5.7.38-linux-glibc2.12-x86_64
drwxr-xr-x. 11 root root 164 Jul 14 16:31 nginx
drwxr-xr-x.  2 root root   6 Jun 22  2021 sbin
drwxr-xr-x.  5 root root  49 Jun 27 14:18 share
drwxr-xr-x.  2 root root   6 Jun 22  2021 src
[root@150 local]#
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值