mysql5.7.22,linux安装步骤

本文档全面介绍了在Linux系统中安装MySQL5.7.22的步骤,包括环境准备,数据库的下载、解压、复制到指定位置,创建系统mysql组和用户,安装过程,配置my.cnf文件,设置数据库自动启动,以及启动服务并初始化密码等关键环节。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、环境准备

实验环境:centos 7
数据库版本:5.7.22

二、数据库安装
2.1 下载

[root@localhost ~]# cd /usr/local/src
[root@localhost src]# wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz

2.2 解压

[root@localhost src]# tar -zxvf mysql-5.7.22-linux-glibc2.12-x86_64.tar.gz

2.3 复制

 

[root@localhost src]# cp -r mysql-5.7.22-linux-glibc2.12-x86_64 /usr/local/mysql

2.4 添加系统mysql组和mysql用户

[root@localhost src]# groupadd mysql
[root@localhost src]# useradd -r -g mysql mysql

2.5 安装数据库

切到mysql安装目录
[root@localhost src]# cd /usr/local/mysql

修改当前目录拥有者为mysql用户
[root@localhost mysql]# chown -R mysql:mysql ./

安装数据库
[root@localhost mysql]# bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
2018-08-13T03:20:19.548679Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-08-13T03:20:20.166625Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-08-13T03:20:20.333087Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-08-13T03:20:20.426986Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: cefdd8c5-9ea7-11e8-93d9-080027b2b4d5.
2018-08-13T03:20:20.429236Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-08-13T03:20:20.432428Z 1 [Note] A 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

「已注销」

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值