linux在线安装mysql

1. linux在线安装mysql(上次安装失败了)
  1. 下载Repo

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

2.安装repo

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

3.开始安装MySQL服务器。

yum -y install mysql-community-server

 

 4.启动mysql服务

systemctl start  mysqld.service

5.查看mysql的状态

systemctl status mysqld.service

 

 

6.查看原生密码

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

 

 

7.修改原生密码

  7.1 本地登录 mysql -uroot -p

   7.2 修改密码ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';

 

 

因为密码必须有字母数字特殊符组成。

   7.3 设置允许使用简单密码

set global validate_password_policy=0;

set global validate_password_length=1;

   7.4修改完成后再使用

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

  1. 设置远程连接。
    1. 切换数据库  use mysql

 

 

  1. 在window下测试远程登陆

 

 

安装镜像报错warning:https://blog.csdn.net/fangkang7/article/details/100585122
navicat连接失败:1130 - Host XXX is not allowed to connect to this MySQL server。(解决方案:https://blog.csdn.net/h985161183/article/details/82218710)

posted @ 2021-01-30 21:07  风中灵叶  阅读(247)  评论(0编辑  收藏  举报