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
  • 相关阅读:
    杂谈
    xss bypass 学习记录
    小结--dns注入
    在CentOS 7 安装没有mysql
    备份WordPress
    php留言
    基于mysq搭建的l许愿墙
    http服务的安装与配置
    centos 7忘记密码重置
    安装centos 7 桌面
  • 原文地址:https://www.cnblogs.com/effortsing/p/10391228.html
Copyright © 2011-2022 走看看