• mysql安装


    参考链接 https://my.oschina.net/Laily/blog/713022
    ===========================================================

    查找mariadb版本

    rpm -qa | grep -i mariadb-libs
    -- 强制卸载 mariadb
    rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64

    依次安装
    [root@centos-linux ~]# rpm -ivh mysql-community-common-5.7.17-1.el7.x86_64.rpm
    [root@centos-linux ~]# rpm -ivh mysql-community-libs-5.7.17-1.el7.x86_64.rpm
    [root@centos-linux ~]# rpm -ivh mysql-community-client-5.7.17-1.el7.x86_64.rpm
    [root@centos-linux ~]# rpm -ivh mysql-community-server-5.7.17-1.el7.x86_64.rpm

    ##初始化数据
    mysqld --initialize --user=mysql
    查看临时密钥
    # cat /var/log/mysqld.log
    E*7P0qaepNzS

    #启动mysql
    systemctl start mysqld (stop/restart/status)

    ##设置密码

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

    ##开放外部访问
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'flying' WITH GRANT OPTION;
    #刷新权限
    FLUSH PRIVILEGES;

    -- 开放端口

    firewall-cmd --zone=public --add-port=3306/tcp --permanent

    重启防火墙

    firewall-cmd --reload

    命令含义:

    --zone #作用域
    --add-port=80/tcp #添加端口,格式为:端口/通讯协议
    --permanent #永久生效,没有此参数重启后失效

    重启防火墙

    0.8u*Kb0Vrij
    firewall-cmd --reload

    ##设置密码

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

    ##开放外部访问
    GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
    FLUSH PRIVILEGES;

  • 相关阅读:
    八大 IoT 安全关键技术解析
    IoT: 物联网安全测试经验总结
    业务逻辑漏洞挖掘
    从零开始Android逆向教程(二)——什么是Xposed
    Mac terminal commands
    Obj-C 实现 QFileDialog函数
    打开文件所在目录并选择该文件
    Qt样式表使用注意项
    window响应拖拽文件操作
    Window检测网络连接情况
  • 原文地址:https://www.cnblogs.com/jacksonxiao/p/11285087.html
Copyright © 2020-2023  润新知