• Mysql5.7 安装


    1 安装yum源
    yum localinstall http://repo.mysql.com//mysql57-community-release-el7-7.noarch.rpm
    2 参看源
    vi /etc/yum.repos.d/mysql-community.repo
    [mysql-connectors-community]
    name=MySQL Connectors Community
    baseurl=http://repo.mysql.com/yum/mysql-connectors-community/el/7/$basearch/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

    [mysql-tools-community]
    name=MySQL Tools Community
    baseurl=http://repo.mysql.com/yum/mysql-tools-community/el/7/$basearch/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

    # Enable to use MySQL 5.5
    [mysql55-community]
    name=MySQL 5.5 Community Server
    baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/7/$basearch/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

    # Enable to use MySQL 5.6
    [mysql56-community]
    name=MySQL 5.6 Community Server
    baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/7/$basearch/
    enabled=0
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

    [mysql57-community]
    name=MySQL 5.7 Community Server
    baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/
    enabled=1
    gpgcheck=1
    gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

    3 刷新源
    yum repolist enabled | grep mysql
    4 安装Mysql
    yum install mysql-community-server
    5 启动管理
    systemctl start mysqld #启动MySQLDB
    systemctl stop mysqld #停止MySQLDB
    systemctl restart mysqld #重启MySQLDB
    systemctl enable mysqld #设置开机启动
    6 查看默认密码
    sudo grep 'temporary password' /var/log/mysqld.log
    7 登录,使用默认密码
    mysql -uroot -p
    8 修改默认密码
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass4!';
    9 外部可以访问设置
    grant ALL PRIVILEGES ON *.* to 'root'@'%' identified by 'MyNewPass4' WITH GRANT OPTION;

    注意 root 为登录名 % 为任意IP 指定IP 如下

    GRANT ALL PRIVILEGES ON *.* TO ‘root’@’192.168.1.3′ IDENTIFIED BY ‘mypassword’ WITH GRANT OPTION; 

  • 相关阅读:
    Android导出jar包后的资源使用问题
    怎样设计接口?
    自己动手写shell之chgrp,chown,chmod
    妹子图太多怎么看才好,Swing来支招
    Etcd学习(一)安装和.NETclient測试
    js中return false,return,return true的使用方法及区别
    C语言运算符的优先级
    运动物体检测与跟踪——累积权重构建背景模型
    推理集 —— 现场的观察
    推理集 —— 现场的观察
  • 原文地址:https://www.cnblogs.com/zhangeamon/p/5315463.html
Copyright © 2020-2023  润新知