如何安装mysql


centos7安装mysql5.7

# 1.下载
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm

# 2.安装yum源
rpm -ivh mysql80-community-release-el7-3.noarch.rpm

# 3.查看可用版本(enable)
yum repolist all| grep mysql

# 4.修改可用版本(需要的版本enabled改为1)
vim /etc/yum.repos.d/mysql-community.repo

# 5.查看可用版本(enable)
yum repolist all| grep mysql

# 6.安装mysql
yum install -y mysql-community-server

# 查看初次启动默认密码
grep 'password' /var/log/mysqld.log

# 用默认密码登陆mysql
mysql -u root -p

# 修改root密码
ALTER USER 'root'@'localhost' IDENTIFIED BY 'xxxxx';

文章作者: lcok
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 lcok !
打赏
  目录