Linux服务器使用Yum安装MYSQL

MYSQL

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

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

  • 安装 yum -y install mysql-community-server

  • 启动 systemctl start mysqld.service

  • 查看状态 systemctl status mysqld.service


    查看状态
  • 查看密码 grep "password" /var/log/mysqld.log


    查看密码
  • 登陆MySQL mysql -u root -p
  • 修改密码 ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
  • 密码过于简单设置不成功


    密码设置不成功

设置密码安全等级
set global validate_password_policy=0;
set global validate_password_length=1;

  • 移除源 yum -y remove mysql57-community-release-el7-10.noarch
  • 授权远端连接 grant all on . to root@'%' identified by 'password';

你可能感兴趣的:(Linux服务器使用Yum安装MYSQL)