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
  • 相关阅读:
    Gentle.Net学习笔记一:配置文件设置
    啥时候咱能用上NExcelApi?
    ibus no input window
    QT && GDAL
    安装 purcell 的emacs.d 配置文件
    进程
    C++的cout高阶格式化操作
    C++ 虚函数表解析
    [转]C程序内存区域分配(5个段作用)
    如何写Makefile文件
  • 原文地址:https://www.cnblogs.com/effortsing/p/10391228.html
Copyright © 2011-2022 走看看