yum mysql config_CentOS7 yum安装 MySql

1.下载yum 源

2.安装 yum 源

sudo rpm -Uvh mysql57-community-release-el7-11.noarch.rpm

3.显示所有的 GA 版本

yum repolist all | grep mysql

4.选择安装的版本

sudo yum-config-manager --disable mysql57-community

sudo yum-config-manager --enable mysql56-community

如果遇到sudo:yum-config-manager:找不到命令

yum -y install yum-utils

yum repolist enabled | grep mysql

5.安装

sudo yum install mysql-community-server

6.启动 Mysql Server

sudo service mysqld start

sudo systemctl start mysqld.service

sudo service mysqld status

sudo systemctl status mysqld.service

7.MySQL Server Initialization (for MySQL 5.7 only):

A superuser account 'root'@'localhost' is created. A password for the superuser is set and stored in the error log file. To reveal it, use the following command:

sudo grep 'temporary password' /var/log/mysqld.log

其他版本没有密码

8.修改密码

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('newpass');

可能会报一下错误,5.7版本必须包含大小写字母,数字和特殊字符

ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值