尝试MySQL5.7各种安装姿势

本文详细介绍了在Linux环境下使用YUM方式安装MySQL5.7的过程,包括安装、初始化及修改密码等关键步骤,适合初学者快速上手。

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

一、背景介绍

       MySQL5.7系列出来N久,可是当前很多涉世未深的小伙伴连安装部署都不会,今天正好有点空闲时间,将mysql5.7的各种安装方式带小伙伴们走一遍,顺便也提升下自己,如果有需要可以参考下哦(⊙o⊙)哦!!!

       我们都知道,软件安装一般常用的有yum、编译、二进制 方式,那么现在大家坐好老司机准备开车了啊。

二、YUM安装MySQL5.7 

2.1 yum安装

[root@linux-node1 ~]# cd /usr/local/src/
[root@linux-node1 src]# yum -y localinstall http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm
[root@linux-node1 src]# yum -y install mysql-community-server mysql-community-devel

注:如有问题请检查服务器上是否有冲突文件<rpm命令连接:https://www.runoob.com/linux/linux-yum.html>

2.2 初始化

[root@linux-node1 ~]# systemctl start mysqld
[root@linux-node1 ~]# systemctl enable mysqld
[root@linux-node1 ~]# grep "password" /var/log/mysqld.log    #查看初始密码,需要启动后才能查看
[root@linux-node1 src]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.7.19
Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

2.3 修改密码
 

[root@linux-node1 src]#mysql -uroot -p'eZa?x2q;&;l%'
mysql> set global validate_password_policy=0;
mysql> set global validate_password_length=1;
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxx';

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值