MysqlCenterOs7-安装-Mysql

36次阅读

共计 681 个字符,预计需要花费 2 分钟才能阅读完成。

第一次安装 mysql 服务端。记录一下

  1. 查看当前 Linux 版本,确认版本后,方便选择对应的 mysql 服务

    cat /etc/redhat-release
  2. 下载 MySQL 官方的 Yum Repository
    https://dev.mysql.com/downloa…
  3. 上传到 linux 上后 安装 Repository
  4. 安装 Repository

     yum -y install mysql80-community-release-el7-3.noarch.rpm

  5. 成功后,安装 mysql server

       yum -y install mysql-community-server

  6. 启动 mysql 服务

  7. 更改 mysql 用户密码
    登录 mysql

     mysql -uroot -p

    修改密码

     mysql>  ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;

    修改用户运行远程登录

    mysql> use mysql;
    
    mysql> update user set host = '%' where user = 'root';
    
    mysql> select host, user from user;

    修改 navicat 链接 mysql 的密码

     mysql>  ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

    刷新

     mysql> FLUSH PRIVILEGES;
  8. 关闭防火墙

    查看防火墙状态

    firewall-cmd --state

    停止 firewall

    systemctl stop firewalld.service

基本上就能用了。:)

正文完
 0