centos 安装mysql

1、下载软件

wget -i -c http://dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm

  使用上面的命令就直接下载了安装用的Yum Repository,大概25KB的样子,然后就可以直接yum安装了

yum -y install mysql57-community-release-el7-10.noarch.rpm

  开始安装MySQL服务器

yum -y install mysql-community-server

2、密码设置

  启动MySQL

systemctl start  mysqld.service

  查看状态

systemctl status mysqld.service

  查看默认密码

grep "password" /var/log/mysqld.log

  进入数据库修改密码

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

  配置远程访问

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;

Robin.Liu

三千大千世界,即非世界,是名世界

友情链接

苏ICP备18038860号

Copyright © sogemao.com 版权所有 Robin.Liu