zoukankan      html  css  js  c++  java
  • mysql允许远程机器连接

    mysql> use mysql;
    Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A
    
    Database changed
    mysql> select host, user from user;
    +---------------+---------------+
    | host          | user          |
    +---------------+---------------+
    | %             | root          |
    | 192.168.0.%   | root          |
    | 192.168.0.1.% | root          |
    | localhost     | mysql.session |
    | localhost     | mysql.sys     |
    | localhost     | root          |
    +---------------+---------------+
    6 rows in set (0.00 sec)
    
    mysql> update user set host='%' where user='root';
    ERROR 1062 (23000): Duplicate entry '%-root' for key 'PRIMARY'  #不用管,没有影响,直接下一步
    mysql> flush privileges;
    Query OK, 0 rows affected (0.02 sec)
    
    重启数数据,否则不生效
    
    systemctl restart mysqld
    
    mysql> grant all privileges on *.* TO 'root'@'%' identified by 'jenkins@123' with grant option;
    Query OK, 0 rows affected, 1 warning (0.02 sec)
    mysql>grant all on *.* to root@'localhost' identified by 'jenkins@123' with grant option;
    mysql> alter user 'root'@'localhost' identified by 'jenkins@123';
    mysql> flush privileges;
    Mysql>exit
  • 相关阅读:
    p1229
    2017.01.21
    P1136 超车 归并排序 求逆序对个数
    2017年寒假计划
    递归一题总结(OJ P1117倒牛奶)
    原来scanf读入字符串还能这样..
    2016NOIP总结
    公式推♂倒题
    kmp+DP x 子串相关的计数问题
    XXXXXXXX不会太多吧?
  • 原文地址:https://www.cnblogs.com/effortsing/p/10391228.html
Copyright © 2011-2022 走看看