zoukankan      html  css  js  c++  java
  • Linux Redhat 4.4.7 安装 8.0.13 MySQL Community Server

    1.刚开始安装mysql参考这个:

        https://blog.csdn.net/a116475939/article/details/74625377

    2.修改密码

    mysql> use mysql;
         #先把密码置为空字符串;(不让后面修改密码会报错)
    mysql> update user set authentication_string="" where user="root";
         #这个刷新非常有必要;不让后面执行alter就会出错
    mysql> flush privileges;
    mysql> ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '密码';

    3.创建用户以及赋权

    mysql> create user 'shenbo'@'%' identified by '$mima...';
    Query OK, 0 rows affected (0.21 sec)
    mysql> grant all privileges on *.* to 'shenbo'@'%' ;
    Query OK, 0 rows affected (0.06 sec)
    mysql> flush privileges;
    Query OK, 0 rows affected (0.00 sec)

     4.设置防火墙 vi /etc/sysconfig/iptables

    # Firewall configuration written by system-config-firewall
    # Manual customization of this file is not recommended.
    *filter
    :INPUT ACCEPT [0:0]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [0:0]
    -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
    -A INPUT -p icmp -j ACCEPT
    -A INPUT -i lo -j ACCEPT
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
    -A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
    -A INPUT -j REJECT --reject-with icmp-host-prohibited
    -A FORWARD -j REJECT --reject-with icmp-host-prohibited
    COMMIT

    然后执行 service iptables restart
  • 相关阅读:
    C#static
    Sql中CHARINDEX用法
    分分钟用上C#中的委托和事件
    为什么使用抽象类?有什么好处?
    【NOIP】普及组2009 细胞分裂
    【VIJOS】P1512 SuperBrother打鼹鼠
    【NOIP】提高组2014
    @NOIP2018
    @NOIP2018
    @NOIP2018
  • 原文地址:https://www.cnblogs.com/shenbo-/p/9902272.html
Copyright © 2011-2022 走看看