[Linux] MySQL 单点安装

环境:rhel 7.2

登录  https://dev.mysql.com/downloads/mysql/ 该网址下载以下rpm

mysql-community-client-5.7.19-1.el7.x86_64.rpm

mysql-community-common-5.7.19-1.el7.x86_64.rpm

mysql-community-devel-5.7.19-1.el7.x86_64.rpm

mysql-community-libs-5.7.19-1.el7.x86_64.rpm

mysql-community-server-5.7.19-1.el7.x86_64.rpm

 

1、初始化

# systemctl disable firewalld

# hostnamectl set-hostname mysql-01

# bash

# vi /etc/selinux/config

SELINUX=disabled

# systemctl disbale firewalld

# reboot

 

2、安装

# rpm -qa | egrep "mysql|maria"

# rpm -e mariadb-libs-5.5.44-2.el7.x86_64 --nodeps   # 卸载旧的

# yum -y install net-tools perl

# cd /usr/local/src/

# rpm -ivh mysql-community-*

# systemctl enable mysqld

# systemctl start mysqld

 

3、配置与验证

# more /var/log/mysqld.log | grep pass       # 查看初始密码

# mysql_secure_installation        # 修改密码

# mysql -uroot -p       # 验证

 

 

PS:命令行修改密码

mysql> set password for'root'@'localhost'='newpassword';


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值